Skip to content

Commit

Permalink
bpo-36894: Fix regression in test_multiprocessing_spawn (no tests run…
Browse files Browse the repository at this point in the history
… on Windows) (GH-13290)
  • Loading branch information
pitrou committed May 13, 2019
1 parent 50466c6 commit 95da83d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Lib/multiprocessing/resource_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import sys
import threading
import warnings
import _multiprocessing
import _posixshmem

from . import spawn
from . import util
Expand All @@ -33,10 +31,17 @@

_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):

Expand Down

0 comments on commit 95da83d

Please sign in to comment.