bpo-36894: Fix regression in test_multiprocessing_spawn (no tests run on Windows) (GH-13290)

This commit is contained in:
Antoine Pitrou 2019-05-13 20:02:46 +02:00 committed by GitHub
parent 50466c6650
commit 95da83d9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -20,8 +20,6 @@ import signal
import sys
import threading
import warnings
import _multiprocessing
import _posixshmem
from . import spawn
from . import util
@ -33,10 +31,17 @@ _IGNORED_SIGNALS = (signal.SIGINT, signal.SIGTERM)
_CLEANUP_FUNCS = {
'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):