Issue #28053: Applying refactorings, docs and other cleanup to follow.

This commit is contained in:
Davin Potts 2016-09-09 18:03:10 -05:00
parent f1024f7425
commit 5458647bb8
13 changed files with 77 additions and 40 deletions

View file

@ -4,9 +4,8 @@ import signal
import sys
import _winapi
from . import context
from .context import reduction, get_spawning_popen, set_spawning_popen
from . import spawn
from . import reduction
from . import util
__all__ = ['Popen']
@ -60,15 +59,15 @@ class Popen(object):
util.Finalize(self, _winapi.CloseHandle, (self.sentinel,))
# send information to child
context.set_spawning_popen(self)
set_spawning_popen(self)
try:
reduction.dump(prep_data, to_child)
reduction.dump(process_obj, to_child)
finally:
context.set_spawning_popen(None)
set_spawning_popen(None)
def duplicate_for_child(self, handle):
assert self is context.get_spawning_popen()
assert self is get_spawning_popen()
return reduction.duplicate(handle, self.sentinel)
def wait(self, timeout=None):