summaryrefslogtreecommitdiffstats
path: root/Lib/ensurepip/_uninstall.py
diff options
context:
space:
mode:
authorIgor Filatov <iafilatov@users.noreply.github.com>2017-09-25 01:03:24 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2017-09-25 01:03:24 (GMT)
commitcf7197ae43767c4346864e5b41246f628edd9b51 (patch)
tree31b2ad79968e1509a5b09ced5fc344346700640d /Lib/ensurepip/_uninstall.py
parentda86874a3d8f882d6aedd882b2e27f59b59d6798 (diff)
downloadcpython-cf7197ae43767c4346864e5b41246f628edd9b51.zip
cpython-cf7197ae43767c4346864e5b41246f628edd9b51.tar.gz
cpython-cf7197ae43767c4346864e5b41246f628edd9b51.tar.bz2
[2.7] bpo-31351: Set return code in ensurepip when pip fails (GH-3734)
Previously ensurepip would always report success, even if the pip installation failed. (cherry picked from commit 9adda0cdf89432386b7a04444a6199b580d287a1)
Diffstat (limited to 'Lib/ensurepip/_uninstall.py')
-rw-r--r--Lib/ensurepip/_uninstall.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/ensurepip/_uninstall.py b/Lib/ensurepip/_uninstall.py
index 750365e..b257904 100644
--- a/Lib/ensurepip/_uninstall.py
+++ b/Lib/ensurepip/_uninstall.py
@@ -2,6 +2,7 @@
import argparse
import ensurepip
+import sys
def _main(argv=None):
@@ -23,8 +24,8 @@ def _main(argv=None):
args = parser.parse_args(argv)
- ensurepip._uninstall_helper(verbosity=args.verbosity)
+ return ensurepip._uninstall_helper(verbosity=args.verbosity)
if __name__ == "__main__":
- _main()
+ sys.exit(_main())