summaryrefslogtreecommitdiff
path: root/Lib/plat-mac/applesingle.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/plat-mac/applesingle.py
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-git-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz
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 'Lib/plat-mac/applesingle.py')
-rw-r--r--Lib/plat-mac/applesingle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/plat-mac/applesingle.py b/Lib/plat-mac/applesingle.py
index 76bdb0691c..fdd163d4f7 100644
--- a/Lib/plat-mac/applesingle.py
+++ b/Lib/plat-mac/applesingle.py
@@ -48,7 +48,7 @@ class AppleSingle(object):
header = fileobj.read(AS_HEADER_LENGTH)
try:
magic, version, ig, nentry = struct.unpack(AS_HEADER_FORMAT, header)
- except ValueError, arg:
+ except ValueError as arg:
raise Error, "Unpack header error: %s" % (arg,)
if verbose:
print 'Magic: 0x%8.8x' % (magic,)
@@ -65,7 +65,7 @@ class AppleSingle(object):
for hdr in headers:
try:
restype, offset, length = struct.unpack(AS_ENTRY_FORMAT, hdr)
- except ValueError, arg:
+ except ValueError as arg:
raise Error, "Unpack entry error: %s" % (arg,)
if verbose:
print "Fork %d, offset %d, length %d" % (restype, offset, length)