Skip to content

Commit

Permalink
Improve library installation error messages
Browse files Browse the repository at this point in the history
This commit adds information about python version to error messages about
failed library installation.
  • Loading branch information
deathaxe committed Dec 3, 2023
1 parent 93620d8 commit faf9e40
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions package_control/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,14 @@ def install_library(self, lib):
if modified_paths:
console_write(
'''
Unable to upgrade library "%s" because files on disk have been modified:
Unable to upgrade library "%s" for Python %s because files on disk have been modified:
%s
''',
(lib.name, '\n '.join(sorted(map(sys_path.shortpath, modified_paths), key=lambda s: s.lower())))
(
lib.name,
lib.python_version,
'\n '.join(sorted(map(sys_path.shortpath, modified_paths), key=lambda s: s.lower()))
)
)
return False

Expand Down Expand Up @@ -1244,12 +1248,13 @@ def install_library(self, lib):
if modified_paths:
console_write(
'''
Unable to %s library "%s" because files in the archive have been modified:
Unable to %s library "%s" for Python %s because files in the archive have been modified:
%s
''',
(
'upgrade' if is_upgrade else 'install',
lib.name,
lib.python_version,
'\n '.join(sorted(map(sys_path.shortpath, modified_paths), key=lambda s: s.lower()))
)
)
Expand All @@ -1274,9 +1279,9 @@ def install_library(self, lib):
except ValueError as e:
console_write(
'''
Failed to install the library "%s": %s
Failed to install the library "%s" for Python %s: %s
''',
(lib.name, e)
(lib.name, lib.python_version, e)
)
return False

Expand All @@ -1286,9 +1291,9 @@ def install_library(self, lib):
except OSError as e:
console_write(
'''
Failed to upgrade the library "%s": %s
Failed to upgrade the library "%s" for Python %s: %s
''',
(lib.name, e)
(lib.name, lib.python_version, e)
)
return False

Expand Down

0 comments on commit faf9e40

Please sign in to comment.