]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-146004: fix test_args_from_interpreter_flags on windows (#146580)
authorChris Eibl <138194463+chris-eibl@users.noreply.github.com>
Sun, 29 Mar 2026 04:08:45 +0000 (06:08 +0200)
committerGitHub <noreply@github.com>
Sun, 29 Mar 2026 04:08:45 +0000 (09:38 +0530)
Lib/test/test_support.py

index 47cac1146c60e3da7914ef007ccb7eaed72676d0..d556f96bc532ed15ea4e5e56b6e83e37e188549e 100644 (file)
@@ -577,7 +577,6 @@ class TestSupport(unittest.TestCase):
             ['-X', 'int_max_str_digits=1000'],
             ['-X', 'lazy_imports=all'],
             ['-X', 'no_debug_ranges'],
-            ['-X', 'pycache_prefix=/tmp/pycache'],
             ['-X', 'showrefcount'],
             ['-X', 'tracemalloc'],
             ['-X', 'tracemalloc=3'],
@@ -586,6 +585,12 @@ class TestSupport(unittest.TestCase):
             with self.subTest(opts=opts):
                 self.check_options(opts, 'args_from_interpreter_flags')
 
+        with os_helper.temp_dir() as temp_path:
+            prefix = os.path.join(temp_path, 'pycache')
+            opts = ['-X', f'pycache_prefix={prefix}']
+            with self.subTest(opts=opts):
+                self.check_options(opts, 'args_from_interpreter_flags')
+
         self.check_options(['-I', '-E', '-s', '-P'],
                            'args_from_interpreter_flags',
                            ['-I'])