Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9f422326
Commit
9f422326
authored
Feb 16, 2018
by
Kyle Altendorf
Committed by
Serhiy Storchaka
Feb 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)
parent
243d6d71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
Lib/test/test_trace.py
Lib/test/test_trace.py
+10
-0
Lib/trace.py
Lib/trace.py
+1
-1
Misc/NEWS.d/next/Library/2018-02-15-12-04-29.bpo-32852.HDqIxM.rst
...S.d/next/Library/2018-02-15-12-04-29.bpo-32852.HDqIxM.rst
+1
-0
No files found.
Lib/test/test_trace.py
View file @
9f422326
...
@@ -387,5 +387,15 @@ class TestCommandLine(unittest.TestCase):
...
@@ -387,5 +387,15 @@ class TestCommandLine(unittest.TestCase):
status
,
stdout
,
stderr
=
assert_python_ok
(
'-m'
,
'trace'
,
'-l'
,
TESTFN
)
status
,
stdout
,
stderr
=
assert_python_ok
(
'-m'
,
'trace'
,
'-l'
,
TESTFN
)
self
.
assertIn
(
b'functions called:'
,
stdout
)
self
.
assertIn
(
b'functions called:'
,
stdout
)
def
test_sys_argv_list
(
self
):
with
open
(
TESTFN
,
'w'
)
as
fd
:
self
.
addCleanup
(
unlink
,
TESTFN
)
fd
.
write
(
"import sys
\
n
"
)
fd
.
write
(
"print(type(sys.argv))
\
n
"
)
status
,
direct_stdout
,
stderr
=
assert_python_ok
(
TESTFN
)
status
,
trace_stdout
,
stderr
=
assert_python_ok
(
'-m'
,
'trace'
,
'-l'
,
TESTFN
)
self
.
assertIn
(
direct_stdout
.
strip
(),
trace_stdout
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
Lib/trace.py
View file @
9f422326
...
@@ -705,7 +705,7 @@ def main():
...
@@ -705,7 +705,7 @@ def main():
if
opts
.
filename
is
None
:
if
opts
.
filename
is
None
:
parser
.
error
(
'filename is missing: required with the main options'
)
parser
.
error
(
'filename is missing: required with the main options'
)
sys
.
argv
=
opts
.
filename
,
*
opts
.
arguments
sys
.
argv
=
[
opts
.
filename
,
*
opts
.
arguments
]
sys
.
path
[
0
]
=
os
.
path
.
dirname
(
opts
.
filename
)
sys
.
path
[
0
]
=
os
.
path
.
dirname
(
opts
.
filename
)
t
=
Trace
(
opts
.
count
,
opts
.
trace
,
countfuncs
=
opts
.
listfuncs
,
t
=
Trace
(
opts
.
count
,
opts
.
trace
,
countfuncs
=
opts
.
listfuncs
,
...
...
Misc/NEWS.d/next/Library/2018-02-15-12-04-29.bpo-32852.HDqIxM.rst
0 → 100644
View file @
9f422326
Make sure sys.argv remains as a list when running trace.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment