diff --git a/thefuck/conf.py b/thefuck/conf.py index 611ec84b7..c3f657c2f 100644 --- a/thefuck/conf.py +++ b/thefuck/conf.py @@ -14,8 +14,10 @@ def load_source(name, pathname, _file=None): module_spec.loader.exec_module(module) return module except ImportError: - from imp import load_source - + try: + from importlib.machinery import SourceFileLoader as load_source # Fix compat with Python 3.5+ + except ImportError: # Fallback for really old (< 3.3) Python versions + from imp import load_source # type: ignore class Settings(dict): def __getattr__(self, item):