mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Make test.regrtest.__file__ absolute, this was not always the case when running profile or trace, for example. (issue #9323)
This commit is contained in:
parent
1df1536fb9
commit
dc69e7217a
2 changed files with 13 additions and 1 deletions
|
@ -1458,7 +1458,13 @@ class _ExpectedSkips:
|
|||
return self.expected
|
||||
|
||||
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])
|
||||
|
||||
# When tests are run from the Python build directory, it is best practice
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue