mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #11750: The Windows API functions scattered in the _subprocess and
_multiprocessing.win32 modules now live in a single module "_winapi". Patch by sbt.
This commit is contained in:
parent
c51b7fd65b
commit
23bba4ca39
15 changed files with 1562 additions and 1665 deletions
|
@ -51,7 +51,7 @@ __all__ = ['BufferWrapper']
|
|||
|
||||
if sys.platform == 'win32':
|
||||
|
||||
from _multiprocessing import win32
|
||||
import _winapi
|
||||
|
||||
class Arena(object):
|
||||
|
||||
|
@ -61,7 +61,7 @@ if sys.platform == 'win32':
|
|||
self.size = size
|
||||
self.name = 'pym-%d-%d' % (os.getpid(), next(Arena._counter))
|
||||
self.buffer = mmap.mmap(-1, self.size, tagname=self.name)
|
||||
assert win32.GetLastError() == 0, 'tagname already in use'
|
||||
assert _winapi.GetLastError() == 0, 'tagname already in use'
|
||||
self._state = (self.size, self.name)
|
||||
|
||||
def __getstate__(self):
|
||||
|
@ -71,7 +71,7 @@ if sys.platform == 'win32':
|
|||
def __setstate__(self, state):
|
||||
self.size, self.name = self._state = state
|
||||
self.buffer = mmap.mmap(-1, self.size, tagname=self.name)
|
||||
assert win32.GetLastError() == win32.ERROR_ALREADY_EXISTS
|
||||
assert _winapi.GetLastError() == _winapi.ERROR_ALREADY_EXISTS
|
||||
|
||||
else:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue