Separate error messages for missing 'pip' and 'distribute' (PY-5931)

This commit is contained in:
Andrey Vlasovskikh
2012-03-20 20:50:24 +04:00
parent 8a5e7dbec0
commit 1136fbeaac
2 changed files with 6 additions and 10 deletions

View File

@@ -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]))

View File

@@ -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;
}