svn-fe: allow svnrdump_sim.py to run with Python 3
authorJohn Keeping <john@keeping.me.uk>
Sun, 20 Jan 2013 13:15:35 +0000 (13:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Jan 2013 03:32:35 +0000 (19:32 -0800)
The changes to allow this script to run with Python 3 are minimal and do
not affect its functionality on the versions of Python 2 that are
already supported (2.4 onwards).

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/svn-fe/svnrdump_sim.py

index 17cf6f961f5fdf1e8f790acf7f498dc863e11e45..4e78a1c3cda15659256c7aa64eb98cab7737c61f 100755 (executable)
@@ -14,7 +14,7 @@ if sys.hexversion < 0x02040000:
 
 def getrevlimit():
         var = 'SVNRMAX'
-        if os.environ.has_key(var):
+        if var in os.environ:
                 return os.environ[var]
         return None
 
@@ -44,7 +44,7 @@ def writedump(url, lower, upper):
 
 if __name__ == "__main__":
         if not (len(sys.argv) in (3, 4, 5)):
-                print "usage: %s dump URL -rLOWER:UPPER"
+                print("usage: %s dump URL -rLOWER:UPPER")
                 sys.exit(1)
         if not sys.argv[1] == 'dump': raise NotImplementedError('only "dump" is suppported.')
         url = sys.argv[2]