From 7c9dd44c32084a5a8595d2bc65f2181d7d2f38ce Mon Sep 17 00:00:00 2001 From: DJ Stomp <85457381+DJStompZone@users.noreply.github.com> Date: Wed, 2 Oct 2024 01:35:08 -0500 Subject: [PATCH] Fix compatibility with Python > 3.5 --- thefuck/conf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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):