Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions thefuck/conf.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import importlib.util
import sys
import os

def load_source(name, path):
spec = importlib.util.spec_from_file_location(name, path)
module = importlib.util.module_from_spec(spec)
sys.modules[name] = module
spec.loader.exec_module(module)
return module
import os
import sys
from warnings import warn
from six import text_type
from . import const
from .system import Path

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


class Settings(dict):
def __getattr__(self, item):
Expand Down
12 changes: 11 additions & 1 deletion thefuck/types.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import importlib.util
import sys
import os

def load_source(name, path):
spec = importlib.util.spec_from_file_location(name, path)
module = importlib.util.module_from_spec(spec)
sys.modules[name] = module
spec.loader.exec_module(module)
return module
import os
import sys
from . import logs
from .shells import shell
from .conf import settings, load_source
from .conf import settings
from .const import DEFAULT_PRIORITY, ALL_ENABLED
from .exceptions import EmptyCommand
from .utils import get_alias, format_raw_script
Expand Down