Skip to content

Commit 86f171a

Browse files
committed
refac t
1 parent d4ae6a0 commit 86f171a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

psutil/tests/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def wrapper(*args, **kwargs):
352352

353353
@_reap_children_on_err
354354
def spawn_testproc(cmd=None, **kwds):
355-
"""Creates a python subprocess which does nothing for 60 secs and
355+
"""Create a python subprocess which does nothing for some secs and
356356
return it as a subprocess.Popen instance.
357357
If "cmd" is specified that is used instead of python.
358358
By default stdin and stdout are redirected to /dev/null.
@@ -371,13 +371,13 @@ def spawn_testproc(cmd=None, **kwds):
371371
CREATE_NO_WINDOW = 0x8000000
372372
kwds.setdefault("creationflags", CREATE_NO_WINDOW)
373373
if cmd is None:
374-
testfn = get_testfn()
374+
testfn = get_testfn(dir=os.getcwd())
375375
try:
376376
safe_rmpath(testfn)
377377
pyline = (
378-
"from time import sleep;"
378+
"import time;"
379379
+ "open(r'%s', 'w').close();" % testfn
380-
+ "[sleep(0.1) for x in range(100)];" # 10 secs
380+
+ "[time.sleep(0.1) for x in range(100)];" # 10 secs
381381
)
382382
cmd = [PYTHON_EXE, "-c", pyline]
383383
sproc = subprocess.Popen(cmd, **kwds)

0 commit comments

Comments
 (0)