[Scummvm-cvs-logs] SF.net SVN: scummvm:[54387] scummvm/trunk/test/cxxtest/cxxtestgen.py

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Nov 19 19:19:34 CET 2010


Revision: 54387
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54387&view=rev
Author:   lordhoto
Date:     2010-11-19 18:19:34 +0000 (Fri, 19 Nov 2010)

Log Message:
-----------
TEST: Make cxxtest work with Python 3.1 too.

Modified Paths:
--------------
    scummvm/trunk/test/cxxtest/cxxtestgen.py

Modified: scummvm/trunk/test/cxxtest/cxxtestgen.py
===================================================================
--- scummvm/trunk/test/cxxtest/cxxtestgen.py	2010-11-19 17:09:47 UTC (rev 54386)
+++ scummvm/trunk/test/cxxtest/cxxtestgen.py	2010-11-19 18:19:34 UTC (rev 54387)
@@ -57,7 +57,7 @@
 def usage( problem = None ):
     '''Print usage info and exit'''
     if problem is None:
-        print usageString()
+        print( usageString() )
         sys.exit(0)
     else:
         sys.stderr.write( usageString() )
@@ -82,7 +82,7 @@
                                             'error-printer', 'abort-on-fail', 'have-std', 'no-std',
                                             'have-eh', 'no-eh', 'template=', 'include=',
                                             'root', 'part', 'no-static-init', 'factor', 'longlong='] )
-    except getopt.error, problem:
+    except getopt.error as problem:
         usage( problem )
     setOptions( options )
     return setFiles( patterns )
@@ -315,7 +315,7 @@
 
 def cstr( str ):
     '''Convert a string to its C representation'''
-    return '"' + string.replace( str, '\\', '\\\\' ) + '"'
+    return '"' + str.replace( '\\', '\\\\' ) + '"'
 
 
 def addSuiteCreateDestroy( suite, which, line ):
@@ -335,10 +335,10 @@
 
 def verifySuite(suite):
     '''Verify current suite is legal'''
-    if suite.has_key('create') and not suite.has_key('destroy'):
+    if 'create' in suite and not 'destroy' in suite:
         abort( '%s:%s: Suite %s has createSuite() but no destroySuite()' %
                (suite['file'], suite['create'], suite['name']) )
-    if suite.has_key('destroy') and not suite.has_key('create'):
+    if 'destroy' in suite and not 'create' in suite:
         abort( '%s:%s: Suite %s has destroySuite() but no createSuite()' %
                (suite['file'], suite['destroy'], suite['name']) )
 
@@ -474,7 +474,7 @@
 
 def isDynamic(suite):
     '''Checks whether a suite is dynamic'''
-    return suite.has_key('create')
+    return 'create' in suite
 
 lastIncluded = ''
 def writeInclude(output, file):


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list