[Python-checkins] r66924 - in python/branches/release26-maint: Lib/idlelib/PyShell.py Lib/idlelib/run.py
benjamin.peterson
python-checkins at python.org
Thu Oct 16 21:46:26 CEST 2008
Author: benjamin.peterson
Date: Thu Oct 16 21:46:25 2008
New Revision: 66924
Log:
Merged revisions 66922 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r66922 | benjamin.peterson | 2008-10-16 14:40:14 -0500 (Thu, 16 Oct 2008) | 1 line
use new showwarnings signature for idle #3391
........
Modified:
python/branches/release26-maint/ (props changed)
python/branches/release26-maint/Lib/idlelib/PyShell.py
python/branches/release26-maint/Lib/idlelib/run.py
Modified: python/branches/release26-maint/Lib/idlelib/PyShell.py
==============================================================================
--- python/branches/release26-maint/Lib/idlelib/PyShell.py (original)
+++ python/branches/release26-maint/Lib/idlelib/PyShell.py Thu Oct 16 21:46:25 2008
@@ -55,18 +55,22 @@
except ImportError:
pass
else:
- def idle_showwarning(message, category, filename, lineno):
+ def idle_showwarning(message, category, filename, lineno,
+ file=None, line=None):
file = warning_stream
try:
- file.write(warnings.formatwarning(message, category, filename, lineno))
+ file.write(warnings.formatwarning(message, category, filename,\
+ lineno, file=file, line=line))
except IOError:
pass ## file (probably __stderr__) is invalid, warning dropped.
warnings.showwarning = idle_showwarning
- def idle_formatwarning(message, category, filename, lineno):
+ def idle_formatwarning(message, category, filename, lineno,
+ file=None, line=None):
"""Format warnings the IDLE way"""
s = "\nWarning (from warnings module):\n"
s += ' File \"%s\", line %s\n' % (filename, lineno)
- line = linecache.getline(filename, lineno).strip()
+ line = linecache.getline(filename, lineno).strip() \
+ if line is None else line
if line:
s += " %s\n" % line
s += "%s: %s\n>>> " % (category.__name__, message)
Modified: python/branches/release26-maint/Lib/idlelib/run.py
==============================================================================
--- python/branches/release26-maint/Lib/idlelib/run.py (original)
+++ python/branches/release26-maint/Lib/idlelib/run.py Thu Oct 16 21:46:25 2008
@@ -24,11 +24,13 @@
except ImportError:
pass
else:
- def idle_formatwarning_subproc(message, category, filename, lineno):
+ def idle_formatwarning_subproc(message, category, filename, lineno,
+ file=None, line=None):
"""Format warnings the IDLE way"""
s = "\nWarning (from warnings module):\n"
s += ' File \"%s\", line %s\n' % (filename, lineno)
- line = linecache.getline(filename, lineno).strip()
+ line = linecache.getline(filename, lineno).strip() \
+ if line is None else line
if line:
s += " %s\n" % line
s += "%s: %s\n" % (category.__name__, message)
More information about the Python-checkins
mailing list