diff options
Diffstat (limited to 'test/cxxtest')
-rwxr-xr-x | test/cxxtest/cxxtestgen.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/cxxtest/cxxtestgen.py b/test/cxxtest/cxxtestgen.py index 831d23ab41..4145c3ca3e 100755 --- a/test/cxxtest/cxxtestgen.py +++ b/test/cxxtest/cxxtestgen.py @@ -57,7 +57,7 @@ def main(): 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 @@ def parseCommandline(): '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 scanLineForDestroy( suite, lineNo, line ): 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 closeSuite(): 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 isGenerated(suite): def isDynamic(suite): '''Checks whether a suite is dynamic''' - return suite.has_key('create') + return 'create' in suite lastIncluded = '' def writeInclude(output, file): |