diff options
author | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
commit | b940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch) | |
tree | 0b9ea19eba1e665dac95126c3140ac2bc36326ad /Mac/Demo | |
parent | 893523e80a2003d4a630aafb84ba016e0070cbbd (diff) | |
download | cpython-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 'Mac/Demo')
-rw-r--r-- | Mac/Demo/applescript/makedisk.py | 2 | ||||
-rw-r--r-- | Mac/Demo/imgbrowse/imgbrowse.py | 2 | ||||
-rw-r--r-- | Mac/Demo/mlte/mlted.py | 2 | ||||
-rw-r--r-- | Mac/Demo/resources/copyres.py | 2 | ||||
-rw-r--r-- | Mac/Demo/textedit/ped.py | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/Mac/Demo/applescript/makedisk.py b/Mac/Demo/applescript/makedisk.py index 91210ee..013331c 100644 --- a/Mac/Demo/applescript/makedisk.py +++ b/Mac/Demo/applescript/makedisk.py @@ -7,7 +7,7 @@ talker.activate() filespec = macfs.FSSpec('my disk image.img') try: objref = talker.create('my disk image', saving_as=filespec, leave_image_mounted=1) -except Disk_Copy.Error, arg: +except Disk_Copy.Error as arg: print "ERROR: my disk image:", arg else: print 'objref=', objref diff --git a/Mac/Demo/imgbrowse/imgbrowse.py b/Mac/Demo/imgbrowse/imgbrowse.py index 28dffd3..57cddd3 100644 --- a/Mac/Demo/imgbrowse/imgbrowse.py +++ b/Mac/Demo/imgbrowse/imgbrowse.py @@ -52,7 +52,7 @@ class imgbrowse(FrameWork.Application): bar = EasyDialogs.ProgressBar('Reading and converting...') try: rdr = img.reader(imgformat.macrgb16, pathname) - except img.error, arg: + except img.error as arg: EasyDialogs.Message(repr(arg)) return w, h = rdr.width, rdr.height diff --git a/Mac/Demo/mlte/mlted.py b/Mac/Demo/mlte/mlted.py index 323ea62..f9ccd21 100644 --- a/Mac/Demo/mlte/mlted.py +++ b/Mac/Demo/mlte/mlted.py @@ -275,7 +275,7 @@ class Mlted(Application): fp = open(path, 'rb') # NOTE binary, we need cr as end-of-line data = fp.read() fp.close() - except IOError, arg: + except IOError as arg: EasyDialogs.Message("IOERROR: %r" % (arg,)) return else: diff --git a/Mac/Demo/resources/copyres.py b/Mac/Demo/resources/copyres.py index cb1fa8e..da55b06 100644 --- a/Mac/Demo/resources/copyres.py +++ b/Mac/Demo/resources/copyres.py @@ -39,7 +39,7 @@ def copyres(src, dst): UseResFile(output) try: res2 = Get1Resource(type, id) - except (RuntimeError, Res.Error), msg: + except (RuntimeError, Res.Error) as msg: res2 = None if res2: print "Duplicate type+id, not copied" diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py index 3e91b32..8cd4713 100644 --- a/Mac/Demo/textedit/ped.py +++ b/Mac/Demo/textedit/ped.py @@ -273,7 +273,7 @@ class Ped(Application): fp = open(path, 'rb') # NOTE binary, we need cr as end-of-line data = fp.read() fp.close() - except IOError, arg: + except IOError as arg: EasyDialogs.Message("IOERROR: %r" % (arg,)) return else: |