Skip to content

Commit

Permalink
fix: added importlib fallback
Browse files Browse the repository at this point in the history
To allow compatibility with Python 3.12.
  • Loading branch information
joamag committed Oct 14, 2023
1 parent 8f76e3d commit d6b1796
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/netius/base/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
""" The license for the module """

import os
import imp
import sys
import inspect
import functools
Expand Down Expand Up @@ -89,6 +88,9 @@ def ctx_absolute():
try: import cPickle
except ImportError: import pickle; cPickle = pickle

try: import importlib
except ImportError: import imp; importlib = imp

try: import cStringIO
except ImportError: import io; cStringIO = io

Expand Down Expand Up @@ -332,7 +334,7 @@ def reduce(*args, **kwargs):
return _reduce(*args, **kwargs)

def reload(*args, **kwargs):
if PYTHON_3: return imp.reload(*args, **kwargs)
if PYTHON_3: return importlib.reload(*args, **kwargs)
return _reload(*args, **kwargs)

def unichr(*args, **kwargs):
Expand Down

0 comments on commit d6b1796

Please sign in to comment.