Mercurial > p > roundup > code
diff scripts/copy-user.py @ 5248:198b6e810c67
Use Python-3-compatible 'as' syntax for except statements
Many raise statements near these are also fixed.
So are two ivorrect file encoding marks ('utf8'->'utf-8').
| author | Eric S. Raymond <esr@thyrsus.com> |
|---|---|
| date | Thu, 24 Aug 2017 22:21:37 -0400 |
| parents | 6e9b9743de89 |
| children | 64b05e24dbd8 |
line wrap: on
line diff
--- a/scripts/copy-user.py Thu Aug 24 17:55:02 2017 -0400 +++ b/scripts/copy-user.py Thu Aug 24 22:21:37 2017 -0400 @@ -49,7 +49,7 @@ for userid in userids: try: userid = str(int(userid)) - except ValueError, why: + except ValueError as why: print "Not a numeric user id: %s Skipping ..." % (userid,) continue if userid not in userlist: @@ -65,7 +65,7 @@ db2.user.lookup(user['username']) print "User %s: Username '%s' exists in target instance. Skipping ..." % (userid, user['username']) continue - except KeyError, why: + except KeyError as why: pass print "Copying user %s (%s) ..." % (userid, user['username']) db2.user.create(**user)
