mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
bpo-36894: Fix regression in test_multiprocessing_spawn (no tests run on Windows) (GH-13290)
This commit is contained in:
parent
50466c6650
commit
95da83d9ba
1 changed files with 9 additions and 4 deletions
|
|
@ -20,8 +20,6 @@ import signal
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import warnings
|
import warnings
|
||||||
import _multiprocessing
|
|
||||||
import _posixshmem
|
|
||||||
|
|
||||||
from . import spawn
|
from . import spawn
|
||||||
from . import util
|
from . import util
|
||||||
|
|
@ -33,10 +31,17 @@ _IGNORED_SIGNALS = (signal.SIGINT, signal.SIGTERM)
|
||||||
|
|
||||||
_CLEANUP_FUNCS = {
|
_CLEANUP_FUNCS = {
|
||||||
'noop': lambda: None,
|
'noop': lambda: None,
|
||||||
'semaphore': _multiprocessing.sem_unlink,
|
|
||||||
'shared_memory': _posixshmem.shm_unlink
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if os.name == 'posix':
|
||||||
|
import _multiprocessing
|
||||||
|
import _posixshmem
|
||||||
|
|
||||||
|
_CLEANUP_FUNCS.update({
|
||||||
|
'semaphore': _multiprocessing.sem_unlink,
|
||||||
|
'shared_memory': _posixshmem.shm_unlink,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
class ResourceTracker(object):
|
class ResourceTracker(object):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue