summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter/guido
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 (GMT)
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 (GMT)
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Demo/tkinter/guido
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.zip
cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz
cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.bz2
SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V" (b) V is now limited to a simple name (local variable) (c) V is now deleted at the end of the except block
Diffstat (limited to 'Demo/tkinter/guido')
-rwxr-xr-xDemo/tkinter/guido/AttrDialog.py14
-rwxr-xr-xDemo/tkinter/guido/ManPage.py2
-rwxr-xr-xDemo/tkinter/guido/mbox.py2
-rwxr-xr-xDemo/tkinter/guido/tkman.py2
-rwxr-xr-xDemo/tkinter/guido/wish.py2
5 files changed, 11 insertions, 11 deletions
diff --git a/Demo/tkinter/guido/AttrDialog.py b/Demo/tkinter/guido/AttrDialog.py
index 9fa699e..d8b2571 100755
--- a/Demo/tkinter/guido/AttrDialog.py
+++ b/Demo/tkinter/guido/AttrDialog.py
@@ -156,7 +156,7 @@ class PackDialog(Dialog):
self.current = self.var.get()
try:
self.dialog.widget.pack(**{self.option: self.current})
- except TclError, msg:
+ except TclError as msg:
print msg
self.refresh()
@@ -212,7 +212,7 @@ class RemotePackDialog(PackDialog):
'pack',
'info',
self.widget))
- except TclError, msg:
+ except TclError as msg:
print msg
return
dict = {}
@@ -239,7 +239,7 @@ class RemotePackDialog(PackDialog):
'-'+self.option,
self.dialog.master.tk.merge(
self.current))
- except TclError, msg:
+ except TclError as msg:
print msg
self.refresh()
@@ -285,7 +285,7 @@ class WidgetDialog(Dialog):
self.current = self.var.get()
try:
self.dialog.widget[self.option] = self.current
- except TclError, msg:
+ except TclError as msg:
print msg
self.refresh()
@@ -374,7 +374,7 @@ class RemoteWidgetDialog(WidgetDialog):
self.master.send(self.app,
self.widget,
'config'))
- except TclError, msg:
+ except TclError as msg:
print msg
return
dict = {}
@@ -398,7 +398,7 @@ class RemoteWidgetDialog(WidgetDialog):
'config',
'-'+self.option,
self.current)
- except TclError, msg:
+ except TclError as msg:
print msg
self.refresh()
@@ -445,7 +445,7 @@ def opendialogs(e):
if widget == '.': continue
try:
RemotePackDialog(list, list.app, widget)
- except TclError, msg:
+ except TclError as msg:
print msg
test()
diff --git a/Demo/tkinter/guido/ManPage.py b/Demo/tkinter/guido/ManPage.py
index 221af88..b189b64 100755
--- a/Demo/tkinter/guido/ManPage.py
+++ b/Demo/tkinter/guido/ManPage.py
@@ -95,7 +95,7 @@ class EditableManPage(ScrolledText):
self._parseline('')
try:
self.tk.deletefilehandler(self.fp)
- except TclError, msg:
+ except TclError as msg:
pass
self.fp.close()
self.fp = None
diff --git a/Demo/tkinter/guido/mbox.py b/Demo/tkinter/guido/mbox.py
index 3c36d88..47c38b9 100755
--- a/Demo/tkinter/guido/mbox.py
+++ b/Demo/tkinter/guido/mbox.py
@@ -27,7 +27,7 @@ def main():
seq = 'all'
try:
opts, args = getopt.getopt(sys.argv[1:], '')
- except getopt.error, msg:
+ except getopt.error as msg:
print msg
sys.exit(2)
for arg in args:
diff --git a/Demo/tkinter/guido/tkman.py b/Demo/tkinter/guido/tkman.py
index 6b0b641..810bdf8 100755
--- a/Demo/tkinter/guido/tkman.py
+++ b/Demo/tkinter/guido/tkman.py
@@ -216,7 +216,7 @@ class SelectionBox:
prog = re.compile(search, map)
else:
prog = re.compile(search)
- except re.error, msg:
+ except re.error as msg:
self.frame.bell()
print 'Regex error:', msg
return
diff --git a/Demo/tkinter/guido/wish.py b/Demo/tkinter/guido/wish.py
index 35e012c..2367e25 100755
--- a/Demo/tkinter/guido/wish.py
+++ b/Demo/tkinter/guido/wish.py
@@ -23,7 +23,7 @@ while 1:
tk.record(line)
try:
result = tk.call('eval', cmd)
- except _tkinter.TclError, msg:
+ except _tkinter.TclError as msg:
print 'TclError:', msg
else:
if result: print result