summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/idlelib/macosxSupport.py8
-rw-r--r--Lib/test/test_traceback.py4
-rw-r--r--Lib/traceback.py8
3 files changed, 10 insertions, 10 deletions
diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py
index 8aea160..ad61fff 100644
--- a/Lib/idlelib/macosxSupport.py
+++ b/Lib/idlelib/macosxSupport.py
@@ -30,7 +30,7 @@ def overrideRootMenu(root, flist):
Replace the Tk root menu by something that's more appropriate for
IDLE.
"""
- # The menu that is attached to the Tk root (".") is also used by AquaTk for
+ # The menu that is attached to the Tk root (".") is also used by AquaTk for
# all windows that don't specify a menu of their own. The default menubar
# contains a number of menus, none of which are appropriate for IDLE. The
# Most annoying of those is an 'About Tck/Tk...' menu in the application
@@ -82,7 +82,7 @@ def overrideRootMenu(root, flist):
for mname, entrylist in Bindings.menudefs:
menu = menudict.get(mname)
- if not menu:
+ if not menu:
continue
for entry in entrylist:
if not entry:
@@ -90,14 +90,14 @@ def overrideRootMenu(root, flist):
else:
label, eventname = entry
underline, label = prepstr(label)
- accelerator = get_accelerator(Bindings.default_keydefs,
+ accelerator = get_accelerator(Bindings.default_keydefs,
eventname)
def command(text=root, eventname=eventname):
text.event_generate(eventname)
menu.add_command(label=label, underline=underline,
command=command, accelerator=accelerator)
-
+
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index 4ecd2cd..7f0ede5 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -112,7 +112,7 @@ def test():
self.assertEqual(lst, ['KeyboardInterrupt\n'])
# String exceptions are deprecated, but legal. The quirky form with
- # separate "type" and "value" tends to break things, because
+ # separate "type" and "value" tends to break things, because
# not isinstance(value, type)
# and a string cannot be the first argument to issubclass.
#
@@ -139,7 +139,7 @@ def test():
err = traceback.format_exception_only(str_type, str_value)
self.assert_(len(err) == 1)
self.assert_(err[0] == str_type + ': ' + str_value + '\n')
-
+
def test_main():
run_unittest(TracebackCases)
diff --git a/Lib/traceback.py b/Lib/traceback.py
index f634159..a0b5759 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -172,7 +172,7 @@ def format_exception_only(etype, value):
isinstance(etype, types.InstanceType) or
type(etype) is str):
return [_format_final_exc_line(etype, value)]
-
+
stype = etype.__name__
if not issubclass(etype, SyntaxError):
@@ -196,18 +196,18 @@ def format_exception_only(etype, value):
# only three spaces to account for offset1 == pos 0
lines.append(' %s^\n' % ''.join(caretspace))
value = msg
-
+
lines.append(_format_final_exc_line(stype, value))
return lines
def _format_final_exc_line(etype, value):
"""Return a list of a single line -- normal case for format_exception_only"""
- if value is None or not str(value):
+ if value is None or not str(value):
line = "%s\n" % etype
else:
line = "%s: %s\n" % (etype, _some_str(value))
return line
-
+
def _some_str(value):
try:
return str(value)