mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
explain the nested import
This commit is contained in:
parent
e6ee13d11b
commit
a29b061f91
@ -125,6 +125,13 @@ class GetArgvTests(SyncTestCase):
|
||||
``get_argv`` returns a list representing the result of tokenizing the
|
||||
"command line" argument string provided to Windows processes.
|
||||
"""
|
||||
# Python 2.7 doesn't have good options for launching a process with
|
||||
# non-ASCII in its command line. So use this alternative that does a
|
||||
# better job. Bury the import here because it only works on Windows.
|
||||
from ._win_subprocess import (
|
||||
Popen
|
||||
)
|
||||
|
||||
working_path = FilePath(self.mktemp())
|
||||
working_path.makedirs()
|
||||
save_argv_path = working_path.child("script.py")
|
||||
@ -144,11 +151,6 @@ class GetArgvTests(SyncTestCase):
|
||||
f.write(json.dumps(get_argv()))
|
||||
""".format(saved_argv_path.path)),
|
||||
)
|
||||
# Python 2.7 doesn't have good options for launching a process with
|
||||
# non-ASCII in its command line.
|
||||
from ._win_subprocess import (
|
||||
Popen
|
||||
)
|
||||
argv = [executable.decode("utf-8"), save_argv_path.path] + argv
|
||||
p = Popen(argv, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
p.stdin.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user