orion / rpms / python3x-pip

Forked from rpms/python3x-pip 2 years ago
Clone
bcedfd
--- /usr/bin/pip3	2018-03-29 15:22:13.000000000 +0200
bcedfd
+++ pip3	2018-05-04 11:49:08.098821010 +0200
bcedfd
@@ -4,7 +4,16 @@
bcedfd
 import re
bcedfd
 import sys
bcedfd
 
bcedfd
-from pip._internal import main
bcedfd
+try:
bcedfd
+    from pip._internal import main
bcedfd
+except ImportError:
bcedfd
+    # user has most probably downgraded pip in their home
bcedfd
+    # so let them run it anyway until ~/.local/bin makes it in front of the PATH
bcedfd
+    from pip import main
bcedfd
+else:
bcedfd
+    # user might also upgraded pip...
bcedfd
+    if hasattr(main, 'main'):
bcedfd
+        main = main.main
bcedfd
 
bcedfd
 if __name__ == '__main__':
bcedfd
     sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])