Skip to content

Commit

Permalink
Move threading import to module level of importlib.util
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Feb 17, 2024
1 parent bb2292f commit 57fe084
Showing 1 changed file with 1 addition and 2 deletions.
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

0 comments on commit 57fe084

Please sign in to comment.