mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
Merge f31338773fdc84a984ce1ec31a5d226690e96390 into c7e7e1d884d3bb241ea6448f72a989434c2a35ec
This commit is contained in:
commit
6a686f659d
@ -9,3 +9,5 @@ pypandoc
|
|||||||
pytest-benchmark
|
pytest-benchmark
|
||||||
pytest-docker-pexpect
|
pytest-docker-pexpect
|
||||||
twine
|
twine
|
||||||
|
pathlib2
|
||||||
|
importlib
|
||||||
|
@ -4,18 +4,13 @@ from warnings import warn
|
|||||||
from six import text_type
|
from six import text_type
|
||||||
from . import const
|
from . import const
|
||||||
from .system import Path
|
from .system import Path
|
||||||
|
import importlib.util
|
||||||
|
|
||||||
try:
|
def load_source(name, pathname, _file=None):
|
||||||
import importlib.util
|
module_spec = importlib.util.spec_from_file_location(name, pathname)
|
||||||
|
module = importlib.util.module_from_spec(module_spec)
|
||||||
def load_source(name, pathname, _file=None):
|
module_spec.loader.exec_module(module)
|
||||||
module_spec = importlib.util.spec_from_file_location(name, pathname)
|
return module
|
||||||
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):
|
class Settings(dict):
|
||||||
def __getattr__(self, item):
|
def __getattr__(self, item):
|
||||||
|
@ -3,7 +3,7 @@ import sys
|
|||||||
import tty
|
import tty
|
||||||
import termios
|
import termios
|
||||||
import colorama
|
import colorama
|
||||||
from distutils.spawn import find_executable
|
from shutil import which
|
||||||
from .. import const
|
from .. import const
|
||||||
|
|
||||||
init_output = colorama.init
|
init_output = colorama.init
|
||||||
@ -38,7 +38,7 @@ def get_key():
|
|||||||
|
|
||||||
|
|
||||||
def open_command(arg):
|
def open_command(arg):
|
||||||
if find_executable('xdg-open'):
|
if which('xdg-open'):
|
||||||
return 'xdg-open ' + arg
|
return 'xdg-open ' + arg
|
||||||
return 'open ' + arg
|
return 'open ' + arg
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user