mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-40492: Fix --outfile with relative path when the program changes it working dir (GH-19910)
This commit is contained in:
parent
b81c833ab5
commit
3c0ac18504
4 changed files with 28 additions and 1 deletions
|
@ -152,6 +152,11 @@ def main():
|
|||
(options, args) = parser.parse_args()
|
||||
sys.argv[:] = args
|
||||
|
||||
# The script that we're profiling may chdir, so capture the absolute path
|
||||
# to the output file at startup.
|
||||
if options.outfile is not None:
|
||||
options.outfile = os.path.abspath(options.outfile)
|
||||
|
||||
if len(args) > 0:
|
||||
if options.module:
|
||||
code = "run_module(modname, run_name='__main__')"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue