diff options
author | Mats Wichmann <mats@linux.com> | 2019-04-25 19:44:24 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-04-25 19:44:24 (GMT) |
commit | 0e84c296d686e4384c8e6f5137a7c15e51dcb167 (patch) | |
tree | c4e043cd046190eaa7d2d6a72a5f87cc85aa23cf /testing | |
parent | f3c5ac37a96adc91d688d17a9ad462a95d32587c (diff) | |
download | SCons-0e84c296d686e4384c8e6f5137a7c15e51dcb167.zip SCons-0e84c296d686e4384c8e6f5137a7c15e51dcb167.tar.gz SCons-0e84c296d686e4384c8e6f5137a7c15e51dcb167.tar.bz2 |
[PR #3345] fix a few more Py3.8 problems
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestSCons.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 23b3416..907eac7 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -949,7 +949,7 @@ class TestSCons(TestCommon): def Qt_dummy_installation(self, dir='qt'): # create a dummy qt installation - self.subdir( dir, [dir, 'bin'], [dir, 'include'], [dir, 'lib'] ) + self.subdir(dir, [dir, 'bin'], [dir, 'include'], [dir, 'lib']) self.write([dir, 'bin', 'mymoc.py'], """\ import getopt @@ -960,11 +960,11 @@ cmd_opts, args = getopt.getopt(sys.argv[1:], 'io:wz', []) impl = 0 opt_string = '' for opt, arg in cmd_opts: - if opt == '-o': out = arg + if opt == '-o': outfile = arg elif opt == '-i': impl = 1 else: opt_string = opt_string + ' ' + opt -with open(out, 'w') as ofp: +with open(outfile, 'w') as ofp: ofp.write("/* mymoc.py%s */\\n" % opt_string) for a in args: with open(a, 'r') as ifp: @@ -972,7 +972,7 @@ with open(out, 'w') as ofp: a = a.replace('\\\\', '\\\\\\\\') subst = r'{ my_qt_symbol( "' + a + '\\\\n" ); }' if impl: - contents = re.sub( r'#include.*', '', contents ) + contents = re.sub(r'#include.*', '', contents) ofp.write(contents.replace('Q_OBJECT', subst)) sys.exit(0) """) @@ -988,7 +988,7 @@ source = None opt_string = '' for arg in sys.argv[1:]: if output_arg: - out = arg + outfile = arg output_arg = 0 elif impl_arg: impl = arg @@ -1004,17 +1004,17 @@ for arg in sys.argv[1:]: sys.exit(1) source = sourceFile = arg -with open(out, 'w') as ofp, open(source, 'r') as ifp: +with open(outfile, 'w') as ofp, open(source, 'r') as ifp: ofp.write("/* myuic.py%s */\\n" % opt_string) if impl: - ofp.write( '#include "' + impl + '"\\n' ) + ofp.write('#include "' + impl + '"\\n') includes = re.findall('<include.*?>(.*?)</include>', ifp.read()) for incFile in includes: # this is valid for ui.h files, at least if os.path.exists(incFile): ofp.write('#include "' + incFile + '"\\n') else: - ofp.write( '#include "my_qobject.h"\\n' + ifp.read() + " Q_OBJECT \\n" ) + ofp.write('#include "my_qobject.h"\\n' + ifp.read() + " Q_OBJECT \\n") sys.exit(0) """ ) @@ -1027,7 +1027,7 @@ void my_qt_symbol(const char *arg); #include "../include/my_qobject.h" #include <stdio.h> void my_qt_symbol(const char *arg) { - fputs( arg, stdout ); + fputs(arg, stdout); } """) @@ -1035,9 +1035,9 @@ void my_qt_symbol(const char *arg) { env = Environment() import sys if sys.platform == 'win32': - env.StaticLibrary( 'myqt', 'my_qobject.cpp' ) + env.StaticLibrary('myqt', 'my_qobject.cpp') else: - env.SharedLibrary( 'myqt', 'my_qobject.cpp' ) + env.SharedLibrary('myqt', 'my_qobject.cpp') """) self.run(chdir = self.workpath(dir, 'lib'), @@ -1080,7 +1080,7 @@ if ARGUMENTS.get('variant_dir', 0): else: sconscript = File('SConscript') Export("env dup") -SConscript( sconscript ) +SConscript(sconscript) """ % (self.QT, self.QT_LIB, self.QT_MOC, self.QT_UIC)) |