Skip to content

Commit

Permalink
CPLAT-4632 Fix for python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dlunch committed Nov 25, 2024
1 parent 6f441c7 commit 4e4c8aa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions django/utils/six.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ def find_module(self, fullname, path=None):
return self
return None

# For python 3.12
def find_spec(self, fullname, path, target=None):
from importlib.util import spec_from_loader
loader = self.find_module(fullname, path)
if loader is None:
return None

return spec_from_loader(fullname, loader)

def __get_module(self, fullname):
try:
return self.known_modules[fullname]
Expand Down

0 comments on commit 4e4c8aa

Please sign in to comment.