1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +00:00

implement coverage tool for function 2

This commit is contained in:
luca-denobili 2024-06-27 15:55:44 +02:00
parent 90eeb9c8f6
commit 4a9514774a

View File

@ -12,6 +12,11 @@ from .logs import warn, exception
from .conf import settings
from .system import Path
branch_coverage = {
"branch_1" : False,
"branch_2" : False
}
DEVNULL = open(os.devnull, 'w')
if six.PY2:
@ -296,15 +301,16 @@ cache.disabled = False
def get_installation_version():
try:
branch_coverage['branch_1'] = True
from importlib.metadata import version
return version('thefuck')
except ImportError:
branch_coverage["branch_2"] = True
import pkg_resources
return pkg_resources.require('thefuck')[0].version
def get_alias():
return os.environ.get('TF_ALIAS', 'fuck')