mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
Separate error messages for missing 'pip' and 'distribute' (PY-5931)
This commit is contained in:
@@ -15,13 +15,13 @@ def error(message, retcode):
|
||||
sys.exit(retcode)
|
||||
|
||||
def error_no_pip():
|
||||
error("Python package management tool 'pip' not found. Please install 'pip'", ERROR_NO_PACKAGING_TOOLS)
|
||||
error("Python package management tool 'pip' not found. Please install 'pip' manually", ERROR_NO_PACKAGING_TOOLS)
|
||||
|
||||
def do_list():
|
||||
try:
|
||||
import pkg_resources
|
||||
except ImportError:
|
||||
error("Python package management tools not found. Please install 'setuptools' or 'distribute'", ERROR_NO_PACKAGING_TOOLS)
|
||||
error("Python package management tools not found. Please install 'setuptools' or 'distribute' manually", ERROR_NO_PACKAGING_TOOLS)
|
||||
for pkg in pkg_resources.working_set:
|
||||
print('\t'.join([pkg.project_name, pkg.version, pkg.location]))
|
||||
|
||||
|
||||
@@ -257,16 +257,12 @@ public class PyPackageManager {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PyPackage findPackage(String name) {
|
||||
try {
|
||||
for (PyPackage pkg : getPackages()) {
|
||||
if (name.equals(pkg.getName())) {
|
||||
return pkg;
|
||||
}
|
||||
public PyPackage findPackage(String name) throws PyExternalProcessException {
|
||||
for (PyPackage pkg : getPackages()) {
|
||||
if (name.equals(pkg.getName())) {
|
||||
return pkg;
|
||||
}
|
||||
}
|
||||
catch (PyExternalProcessException ignored) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user