Skip to content

Commit

Permalink
removed imp module
Browse files Browse the repository at this point in the history
Since it has been depreceated and would be removed from python 3.12 onwards
  • Loading branch information
Coder-Harshit committed Sep 21, 2024
1 parent 83caecc commit f313387
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pytest-benchmark
pytest-docker-pexpect
twine
pathlib2
importlib
17 changes: 6 additions & 11 deletions thefuck/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
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):
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

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

class Settings(dict):
def __getattr__(self, item):
Expand Down

0 comments on commit f313387

Please sign in to comment.