diff options
author | Brett Cannon <brett@python.org> | 2013-06-15 17:23:01 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-15 17:23:01 (GMT) |
commit | 4f4088eb6f768b0af66d6cf682651d7c6a8011b1 (patch) | |
tree | bac24dcbd4021fba5091fe992b21d3773d4c4f74 | |
parent | 61c3556c14d52e553ca5eecc4e178124fac75167 (diff) | |
download | cpython-4f4088eb6f768b0af66d6cf682651d7c6a8011b1.zip cpython-4f4088eb6f768b0af66d6cf682651d7c6a8011b1.tar.gz cpython-4f4088eb6f768b0af66d6cf682651d7c6a8011b1.tar.bz2 |
Issue #17177: Stop using imp in multiprocessing
-rw-r--r-- | Lib/multiprocessing/forking.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py index 8841e4e..d06036d 100644 --- a/Lib/multiprocessing/forking.py +++ b/Lib/multiprocessing/forking.py @@ -449,8 +449,8 @@ def prepare(data): elif main_name != 'ipython': # Main modules not actually called __main__.py may # contain additional code that should still be executed - import imp import importlib + import types if main_path is None: dirs = None @@ -465,7 +465,7 @@ def prepare(data): # since that would execute 'if __name__ == "__main__"' # clauses, potentially causing a psuedo fork bomb. loader = importlib.find_loader(main_name, path=dirs) - main_module = imp.new_module(main_name) + main_module = types.ModuleType(main_name) try: loader.init_module_attrs(main_module) except AttributeError: # init_module_attrs is optional |