summaryrefslogtreecommitdiffstats
path: root/Demo/pdist
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/pdist
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/pdist')
-rwxr-xr-xDemo/pdist/FSProxy.py2
-rwxr-xr-xDemo/pdist/cmdfw.py4
-rwxr-xr-xDemo/pdist/cmptree.py4
-rwxr-xr-xDemo/pdist/cvslock.py4
-rwxr-xr-xDemo/pdist/rrcs.py4
5 files changed, 9 insertions, 9 deletions
diff --git a/Demo/pdist/FSProxy.py b/Demo/pdist/FSProxy.py
index a1ab635..dad4015 100755
--- a/Demo/pdist/FSProxy.py
+++ b/Demo/pdist/FSProxy.py
@@ -87,7 +87,7 @@ class FSProxyLocal:
fs = macfs.FSSpec(name)
c, t = fs.GetCreatorType()
if t != 'TEXT': return 0
- except macfs.error, msg:
+ except macfs.error as msg:
print "***", name, msg
return 0
else:
diff --git a/Demo/pdist/cmdfw.py b/Demo/pdist/cmdfw.py
index e2edd0a..47d13bc 100755
--- a/Demo/pdist/cmdfw.py
+++ b/Demo/pdist/cmdfw.py
@@ -42,7 +42,7 @@ class CommandFrameWork:
if args is None: args = sys.argv[1:]
try:
opts, args = getopt.getopt(args, self.GlobalFlags)
- except getopt.error, msg:
+ except getopt.error as msg:
return self.usage(msg)
self.options(opts)
if not args:
@@ -62,7 +62,7 @@ class CommandFrameWork:
flags = ''
try:
opts, args = getopt.getopt(args[1:], flags)
- except getopt.error, msg:
+ except getopt.error as msg:
return self.usage(
"subcommand %s: " % cmd + str(msg))
self.ready()
diff --git a/Demo/pdist/cmptree.py b/Demo/pdist/cmptree.py
index fa06f5f..5031869 100755
--- a/Demo/pdist/cmptree.py
+++ b/Demo/pdist/cmptree.py
@@ -135,7 +135,7 @@ def compare(local, remote, mode):
def sendfile(local, remote, name):
try:
remote.create(name)
- except (IOError, os.error), msg:
+ except (IOError, os.error) as msg:
print "cannot create:", msg
return
@@ -171,7 +171,7 @@ def recvfile(local, remote, name):
def recvfile_real(local, remote, name):
try:
local.create(name)
- except (IOError, os.error), msg:
+ except (IOError, os.error) as msg:
print "cannot create:", msg
return
diff --git a/Demo/pdist/cvslock.py b/Demo/pdist/cvslock.py
index 8f6d008..6484e71 100755
--- a/Demo/pdist/cvslock.py
+++ b/Demo/pdist/cvslock.py
@@ -129,7 +129,7 @@ class Lock:
self.lockdir = self.cvslck
os.mkdir(self.cvslck, 0777)
return
- except os.error, msg:
+ except os.error as msg:
self.lockdir = None
if msg[0] == EEXIST:
try:
@@ -234,7 +234,7 @@ def MultipleWriteLock(repositories, delay = DELAY):
for r in repositories:
try:
locks.append(WriteLock(r, 0))
- except Locked, instance:
+ except Locked as instance:
del locks
break
else:
diff --git a/Demo/pdist/rrcs.py b/Demo/pdist/rrcs.py
index 4d23e6c..540d296 100755
--- a/Demo/pdist/rrcs.py
+++ b/Demo/pdist/rrcs.py
@@ -22,7 +22,7 @@ def main():
raise getopt.error, "unknown command"
coptset, func = commands[cmd]
copts, files = getopt.getopt(rest, coptset)
- except getopt.error, msg:
+ except getopt.error as msg:
print msg
print "usage: rrcs [options] command [options] [file] ..."
print "where command can be:"
@@ -41,7 +41,7 @@ def main():
for fn in files:
try:
func(x, copts, fn)
- except (IOError, os.error), msg:
+ except (IOError, os.error) as msg:
print "%s: %s" % (fn, msg)
def checkin(x, copts, fn):