Skip to content
Merged
Prev Previous commit
Next Next commit
Move threading import to module level of importlib.util
  • Loading branch information
effigies committed Feb 17, 2024
commit 57fe084717a74ae5bb861385ce2ebfbe318720aa
3 changes: 1 addition & 2 deletions Lib/importlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import _imp
import sys
import threading
import types


Expand Down Expand Up @@ -253,8 +254,6 @@ def create_module(self, spec):

def exec_module(self, module):
"""Make the module load lazily."""
import threading

module.__spec__.loader = self.loader
module.__loader__ = self.loader
# Don't need to worry about deep-copying as trying to set an attribute
Expand Down