summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Saunders <saunders@aggienetwork.com>2022-08-14 23:03:30 -0700
committerRyan Saunders <saunders@aggienetwork.com>2022-08-14 23:03:30 -0700
commit3c2458a8be8a2e466620635cf3b3dee022ebe81d (patch)
treed54c31442bd02efafd217363bb635affbc9147a9
parent91fe386aca3460f60f17b9d17f78d09fbd66d2cc (diff)
downloadscons-git-3c2458a8be8a2e466620635cf3b3dee022ebe81d.tar.gz
Fix handling of posix paths containing backslash, and update tests
-rwxr-xr-xruntest.py7
-rw-r--r--test/runtest/python.py10
-rw-r--r--testing/framework/TestRuntest.py6
3 files changed, 5 insertions, 18 deletions
diff --git a/runtest.py b/runtest.py
index 212d0a8a1..a2ece7ee9 100755
--- a/runtest.py
+++ b/runtest.py
@@ -422,8 +422,7 @@ class PopenExecutor(RuntestBase):
A bit of a misnomer as the Popen call is now wrapped
by calling subprocess.run (behind the covers uses Popen.
- Very similar to SystemExecutor, but uses command_str
- instead of command_args, and doesn't allow for not catching
+ Very similar to SystemExecutor, but doesn't allow for not catching
the output).
"""
# For an explanation of the following 'if ... else'
@@ -437,7 +436,7 @@ class PopenExecutor(RuntestBase):
tmp_stderr = tempfile.TemporaryFile(mode='w+t')
# Start subprocess...
cp = subprocess.run(
- self.command_str.split(),
+ self.command_args,
stdout=tmp_stdout,
stderr=tmp_stderr,
shell=False,
@@ -460,7 +459,7 @@ class PopenExecutor(RuntestBase):
def execute(self, env):
cp = subprocess.run(
- self.command_str.split(),
+ self.command_args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=False,
diff --git a/test/runtest/python.py b/test/runtest/python.py
index 499ab77c0..abd4f0cba 100644
--- a/test/runtest/python.py
+++ b/test/runtest/python.py
@@ -50,20 +50,12 @@ pythonflags = TestRuntest.pythonflags
# getting called with "/bin/../bin/python" as first argument, e.g. Fedora 17 Desktop.
mypython = os.path.normpath(os.path.join(head, dir, os.path.pardir, dir, python))
-def escape(s):
- return s.replace('\\', '\\\\')
-
-if re.search(r'\s', mypython):
- mypythonstring = '"%s"' % escape(mypython)
-else:
- mypythonstring = escape(mypython)
-
test.subdir('test')
test.write_passing_test(['test', 'pass.py'])
expect_stdout = """\
-%(mypythonstring)s%(pythonflags)s %(test_pass_py)s
+%(mypython)s%(pythonflags)s %(test_pass_py)s
PASSING TEST STDOUT
""" % locals()
diff --git a/testing/framework/TestRuntest.py b/testing/framework/TestRuntest.py
index 93689531f..378f44109 100644
--- a/testing/framework/TestRuntest.py
+++ b/testing/framework/TestRuntest.py
@@ -51,11 +51,7 @@ __all__.extend(
]
)
-if re.search(r'\s', python):
- pythonstring = _python_
-else:
- pythonstring = python
-pythonstring = pythonstring.replace('\\', '\\\\')
+pythonstring = python
pythonflags = ''
failing_test_template = """\