File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1458,7 +1458,13 @@ def getexpected(self):
14581458 return self .expected
14591459
14601460if __name__ == '__main__' :
1461- # Simplification for findtestdir().
1461+ # findtestdir() gets the dirname out of __file__, so we have to make it
1462+ # absolute before changing the working directory.
1463+ # For example __file__ may be relative when running trace or profile.
1464+ # See issue #9323.
1465+ __file__ = os .path .abspath (__file__ )
1466+
1467+ # sanity check
14621468 assert __file__ == os .path .abspath (sys .argv [0 ])
14631469
14641470 # When tests are run from the Python build directory, it is best practice
Original file line number Diff line number Diff line change @@ -142,6 +142,12 @@ Tools/Demos
142142 as wide (UCS4) unicode builds for both the host interpreter (embedded
143143 inside gdb) and the interpreter under test.
144144
145+ Tests
146+ -----
147+
148+ - Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
149+ case when running profile or trace, for example.
150+
145151Build
146152-----
147153
You can’t perform that action at this time.
0 commit comments