From: Stefano Rivera Date: Sun, 21 Jan 2024 19:55:16 +0000 (-0400) Subject: autoreload_test: Handle a relative PYTHONPATH X-Git-Tag: v6.5.0b1~48^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3358%2Fhead;p=thirdparty%2Ftornado.git autoreload_test: Handle a relative PYTHONPATH This came up in the Debian package build of tornado, where we run the tests from a staged build of the module. --- diff --git a/tornado/test/autoreload_test.py b/tornado/test/autoreload_test.py index 5675faa2a..d7701c3f5 100644 --- a/tornado/test/autoreload_test.py +++ b/tornado/test/autoreload_test.py @@ -73,9 +73,13 @@ class AutoreloadTest(unittest.TestCase): def run_subprocess(self, args): # Make sure the tornado module under test is available to the test # application - pythonpath = os.getcwd() + parts = [os.getcwd()] if "PYTHONPATH" in os.environ: - pythonpath += os.pathsep + os.environ["PYTHONPATH"] + parts += [ + os.path.join(os.getcwd(), part) + for part in os.environ["PYTHONPATH"].split(os.pathsep) + ] + pythonpath = os.pathsep.join(parts) p = Popen( args,