orion / rpms / python3x-pip

Forked from rpms/python3x-pip 2 years ago
Clone
dfbae6
--- /usr/bin/pip3	2019-11-12 17:37:34.793131862 +0100
dfbae6
+++ pip3	2019-11-12 17:40:42.014107134 +0100
dfbae6
@@ -2,7 +2,23 @@
dfbae6
 # -*- coding: utf-8 -*-
dfbae6
 import re
dfbae6
 import sys
dfbae6
-from pip._internal.cli.main import main
dfbae6
+
dfbae6
+try:
dfbae6
+    from pip._internal.cli.main import main
dfbae6
+except ImportError:
dfbae6
+    try:
dfbae6
+        from pip._internal.main import main
dfbae6
+    except ImportError:
dfbae6
+        try:
dfbae6
+            # If the user has downgraded pip, the above import will fail.
dfbae6
+            # Let's try older methods of invoking it:
dfbae6
+
dfbae6
+            # pip 19 uses this
dfbae6
+            from pip._internal import main
dfbae6
+        except ImportError:
dfbae6
+            # older pip versions use this
dfbae6
+            from pip import main
dfbae6
+
dfbae6
 if __name__ == '__main__':
dfbae6
     sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
dfbae6
     sys.exit(main())