diff options
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/dummy/__init__.py | 2 | ||||
-rw-r--r-- | Lib/multiprocessing/forking.py | 8 | ||||
-rw-r--r-- | Lib/multiprocessing/heap.py | 1 | ||||
-rw-r--r-- | Lib/multiprocessing/managers.py | 6 | ||||
-rw-r--r-- | Lib/multiprocessing/queues.py | 1 | ||||
-rw-r--r-- | Lib/multiprocessing/reduction.py | 2 | ||||
-rw-r--r-- | Lib/multiprocessing/sharedctypes.py | 1 | ||||
-rw-r--r-- | Lib/multiprocessing/synchronize.py | 5 | ||||
-rw-r--r-- | Lib/multiprocessing/util.py | 3 |
9 files changed, 5 insertions, 24 deletions
diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py index 60add92..056acfc 100644 --- a/Lib/multiprocessing/dummy/__init__.py +++ b/Lib/multiprocessing/dummy/__init__.py @@ -46,9 +46,7 @@ import threading import sys import weakref import array -import itertools -from multiprocessing import TimeoutError, cpu_count from multiprocessing.dummy.connection import Pipe from threading import Lock, RLock, Semaphore, BoundedSemaphore from threading import Event, Condition diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py index a2c61ef..47746cb 100644 --- a/Lib/multiprocessing/forking.py +++ b/Lib/multiprocessing/forking.py @@ -35,7 +35,6 @@ import os import sys import signal -import select from multiprocessing import util, process @@ -101,7 +100,6 @@ else: # if sys.platform != 'win32': - import time import select exit = os._exit @@ -170,7 +168,7 @@ if sys.platform != 'win32': if self.returncode is None: try: os.kill(self.pid, signal.SIGTERM) - except OSError as e: + except OSError: if self.wait(timeout=0.1) is None: raise @@ -186,11 +184,9 @@ else: import _thread import msvcrt import _subprocess - import time - from pickle import dump, load, HIGHEST_PROTOCOL + from pickle import load, HIGHEST_PROTOCOL from _multiprocessing import win32 - from .util import Finalize def dump(obj, file, protocol=None): ForkingPickler(file, protocol).dump(obj) diff --git a/Lib/multiprocessing/heap.py b/Lib/multiprocessing/heap.py index 0a25ef0..7366bd2 100644 --- a/Lib/multiprocessing/heap.py +++ b/Lib/multiprocessing/heap.py @@ -34,7 +34,6 @@ import bisect import mmap -import tempfile import os import sys import threading diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 5a57288..f42d353 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -39,19 +39,15 @@ __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # Imports # -import os import sys -import weakref import threading import array import queue from traceback import format_exc -from pickle import PicklingError from multiprocessing import Process, current_process, active_children, Pool, util, connection from multiprocessing.process import AuthenticationString -from multiprocessing.forking import exit, Popen, assert_spawning, ForkingPickler -from multiprocessing.util import Finalize, info +from multiprocessing.forking import exit, Popen, ForkingPickler # # Register some things for pickling diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index cf51307..c4f9cda 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -39,7 +39,6 @@ import os import threading import collections import time -import atexit import weakref import errno diff --git a/Lib/multiprocessing/reduction.py b/Lib/multiprocessing/reduction.py index 042a136..dda4a41 100644 --- a/Lib/multiprocessing/reduction.py +++ b/Lib/multiprocessing/reduction.py @@ -41,7 +41,6 @@ import socket import threading import struct -import _multiprocessing from multiprocessing import current_process from multiprocessing.forking import Popen, duplicate, close, ForkingPickler from multiprocessing.util import register_after_fork, debug, sub_debug @@ -61,7 +60,6 @@ if not(sys.platform == 'win32' or (hasattr(socket, 'CMSG_LEN') and # if sys.platform == 'win32': - import _subprocess from _multiprocessing import win32 def send_handle(conn, handle, destination_pid): diff --git a/Lib/multiprocessing/sharedctypes.py b/Lib/multiprocessing/sharedctypes.py index 1e694da..5826379 100644 --- a/Lib/multiprocessing/sharedctypes.py +++ b/Lib/multiprocessing/sharedctypes.py @@ -32,7 +32,6 @@ # SUCH DAMAGE. # -import sys import ctypes import weakref diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py index 70ae825..e35bbff 100644 --- a/Lib/multiprocessing/synchronize.py +++ b/Lib/multiprocessing/synchronize.py @@ -37,14 +37,11 @@ __all__ = [ ] import threading -import os import sys -from time import time as _time, sleep as _sleep - import _multiprocessing from multiprocessing.process import current_process -from multiprocessing.util import Finalize, register_after_fork, debug +from multiprocessing.util import register_after_fork, debug from multiprocessing.forking import assert_spawning, Popen # Try to import the mp.synchronize module cleanly, if it fails diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index 5c26683..0bbb87e 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -36,7 +36,6 @@ import functools import itertools import weakref import atexit -import select import threading # we want threading to install it's # cleanup function before multiprocessing does @@ -86,7 +85,7 @@ def get_logger(): Returns logger used by multiprocessing ''' global _logger - import logging, atexit + import logging logging._acquireLock() try: |