Commit 27c880ad authored by Florent Xicluna's avatar Florent Xicluna

Make test.regrtest.__file__ absolute, this was not always the case when...

Make test.regrtest.__file__ absolute, this was not always the case when running profile or trace, for example.  (issue #9323)
parent 64b32a2e
...@@ -1458,7 +1458,13 @@ class _ExpectedSkips: ...@@ -1458,7 +1458,13 @@ class _ExpectedSkips:
return self.expected return self.expected
if __name__ == '__main__': if __name__ == '__main__':
# Simplification for findtestdir(). # findtestdir() gets the dirname out of __file__, so we have to make it
# absolute before changing the working directory.
# For example __file__ may be relative when running trace or profile.
# See issue #9323.
__file__ = os.path.abspath(__file__)
# sanity check
assert __file__ == os.path.abspath(sys.argv[0]) assert __file__ == os.path.abspath(sys.argv[0])
# When tests are run from the Python build directory, it is best practice # When tests are run from the Python build directory, it is best practice
......
...@@ -142,6 +142,12 @@ Tools/Demos ...@@ -142,6 +142,12 @@ Tools/Demos
as wide (UCS4) unicode builds for both the host interpreter (embedded as wide (UCS4) unicode builds for both the host interpreter (embedded
inside gdb) and the interpreter under test. inside gdb) and the interpreter under test.
Tests
-----
- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
case when running profile or trace, for example.
Build Build
----- -----
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment