1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-31 02:01:13 +00:00

removed imp module

Since it has been depreceated and would be removed from python 3.12 onwards
This commit is contained in:
Harshit Vijay 2024-09-21 15:43:20 +05:30
parent 83caecc635
commit f31338773f
2 changed files with 7 additions and 11 deletions

View File

@ -10,3 +10,4 @@ pytest-benchmark
pytest-docker-pexpect
twine
pathlib2
importlib

View File

@ -4,18 +4,13 @@ from warnings import warn
from six import text_type
from . import const
from .system import Path
import importlib.util
try:
import importlib.util
def load_source(name, pathname, _file=None):
def load_source(name, pathname, _file=None):
module_spec = importlib.util.spec_from_file_location(name, pathname)
module = importlib.util.module_from_spec(module_spec)
module_spec.loader.exec_module(module)
return module
except ImportError:
from imp import load_source
class Settings(dict):
def __getattr__(self, item):