mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)
(cherry picked from commit 9f4223261f
)
Co-authored-by: Kyle Altendorf <sda@fstab.net>
This commit is contained in:
parent
025544a855
commit
afb5e55836
3 changed files with 12 additions and 1 deletions
|
@ -387,5 +387,15 @@ class TestCommandLine(unittest.TestCase):
|
|||
status, stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN)
|
||||
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__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue