summaryrefslogtreecommitdiffstats
path: root/test/DVIPS
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2020-02-07 18:52:53 (GMT)
committerMats Wichmann <mats@linux.com>2020-02-07 23:39:37 (GMT)
commite8e8d71df80b9b690ef9f2d5b83378f23677e30f (patch)
tree975bfaf04b6b8d63d86fcb0827f4b8e8d226af73 /test/DVIPS
parentef011014b343288919292560fa24e108874c059a (diff)
downloadSCons-e8e8d71df80b9b690ef9f2d5b83378f23677e30f.zip
SCons-e8e8d71df80b9b690ef9f2d5b83378f23677e30f.tar.gz
SCons-e8e8d71df80b9b690ef9f2d5b83378f23677e30f.tar.bz2
Stop calling os.system in tests.
This converts the remaining tests that called os.system themselves to use subprocess instead. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/DVIPS')
-rw-r--r--test/DVIPS/DVIPS.py4
-rw-r--r--test/DVIPS/DVIPSFLAGS.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py
index df7811a..3cfd730 100644
--- a/test/DVIPS/DVIPS.py
+++ b/test/DVIPS/DVIPS.py
@@ -123,11 +123,11 @@ if not dvips:
test.skip_test("Could not find 'dvips'; skipping test(s).\n")
test.write("wrapper.py", """
-import os
+import subprocess
import sys
cmd = " ".join(sys.argv[1:])
open('%s', 'a').write("%%s\\n" %% cmd)
-os.system(cmd)
+subprocess.run(cmd, shell=True)
""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
test.write('SConstruct', """
diff --git a/test/DVIPS/DVIPSFLAGS.py b/test/DVIPS/DVIPSFLAGS.py
index b6625d7..f2e6ba9 100644
--- a/test/DVIPS/DVIPSFLAGS.py
+++ b/test/DVIPS/DVIPSFLAGS.py
@@ -126,11 +126,12 @@ dvips = test.where_is('dvips')
if dvips:
test.write("wrapper.py", """
-import os
+import subprocess
import sys
cmd = " ".join(sys.argv[1:])
-open('%s', 'a').write("%%s\\n" %% cmd)
-os.system(cmd)
+with open('%s', 'a') as f:
+ f.write("%%s\\n" %% cmd)
+subprocess.run(cmd, shell=True)
""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
test.write('SConstruct', """