summaryrefslogtreecommitdiffstats
path: root/Lib/ensurepip/_uninstall.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-12-23 08:20:34 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-12-23 08:20:34 (GMT)
commitf71cae0a93ea0f8ba83da06bdd71709443d521b6 (patch)
treede2017a411c210e363fd3b3768584b9517b40ea7 /Lib/ensurepip/_uninstall.py
parent23f597e4622af79cc14f0040ec61e9fd7a68f862 (diff)
downloadcpython-f71cae0a93ea0f8ba83da06bdd71709443d521b6.zip
cpython-f71cae0a93ea0f8ba83da06bdd71709443d521b6.tar.gz
cpython-f71cae0a93ea0f8ba83da06bdd71709443d521b6.tar.bz2
Issue #19728: fix ensurepip name clash with submodule
Also added refactoring and added basic tests for the argument parsing in both ensurepip._main and ensurepip._uninstall._main.
Diffstat (limited to 'Lib/ensurepip/_uninstall.py')
-rw-r--r--Lib/ensurepip/_uninstall.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ensurepip/_uninstall.py b/Lib/ensurepip/_uninstall.py
index 38c486b..750365e 100644
--- a/Lib/ensurepip/_uninstall.py
+++ b/Lib/ensurepip/_uninstall.py
@@ -4,7 +4,7 @@ import argparse
import ensurepip
-def main():
+def _main(argv=None):
parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall")
parser.add_argument(
"--version",
@@ -21,10 +21,10 @@ def main():
"times."),
)
- args = parser.parse_args()
+ args = parser.parse_args(argv)
- ensurepip._uninstall(verbosity=args.verbosity)
+ ensurepip._uninstall_helper(verbosity=args.verbosity)
if __name__ == "__main__":
- main()
+ _main()