Skip to content

Commit

Permalink
Adjust var style.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Nov 15, 2023
1 parent b58c592 commit b2ab403
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/tabnine.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@
from subprocess import PIPE
from sys import stderr,version_info

versionFn = None
if version_info[1] < 12 :
from distutils.version import StrictVersion
versionFn = StrictVersion
version_function = StrictVersion
else:
from pkg_resources import parse_version
versionFn = parse_version
version_function = parse_version

TABNINE_PROTOCOL_VERSION = "1.0.14"
TABNINE_EXECUTABLE = "TabNine.exe" if get_os_name() == "windows" else "TabNine"
Expand Down Expand Up @@ -85,7 +84,7 @@ def get_tabnine_path(self):
try:
versions = os.listdir(self.tabnine_binaries_folder)
versions = list(filter(lambda f: os.path.isdir(os.path.join(self.tabnine_binaries_folder, f)), versions))
versions.sort(key=versionFn, reverse=True)
versions.sort(key=version_function, reverse=True)
for version in versions:
version_path = os.path.join(self.tabnine_binaries_folder, version)
if os.path.isdir(version_path):
Expand Down

0 comments on commit b2ab403

Please sign in to comment.