@@ -5,7 +5,7 @@ index cfa45d2af..e16292b83 100644
5
5
@@ -49,6 +49,24 @@ if __name__ == '__main__':
6
6
sys.exit(%(func)s())
7
7
'''
8
-
8
+
9
9
+ # Pre-fetch the contents of all executable wrapper stubs.
10
10
+ # This is to address https://github.com/pypa/pip/issues/12666.
11
11
+ # When updating pip, we rename the old pip in place before installing the
@@ -24,9 +24,22 @@ index cfa45d2af..e16292b83 100644
24
24
+ if r.name.endswith(".exe")
25
25
+ }
26
26
+
27
-
27
+
28
28
def enquote_executable(executable):
29
29
if ' ' in executable:
30
+ @@ -164,6 +164,12 @@ class ScriptMaker(object):
31
+ """
32
+ if os.name != 'posix':
33
+ simple_shebang = True
34
+ + elif getattr(sys, "cross_compiling", False):
35
+ + # In a cross-compiling environment, the shebang will likely be a
36
+ + # script; this *must* be invoked with the "safe" version of the
37
+ + # shebang, or else using os.exec() to run the entry script will
38
+ + # fail, raising "OSError 8 [Errno 8] Exec format error".
39
+ + simple_shebang = False
40
+ else:
41
+ # Add 3 for '#!' prefix and newline suffix.
42
+ shebang_length = len(executable) + len(post_interp) + 3
30
43
@@ -409,15 +427,11 @@ class ScriptMaker(object):
31
44
bits = '32'
32
45
platform_suffix = '-arm' if get_platform() == 'win-arm64' else ''
@@ -42,6 +55,6 @@ index cfa45d2af..e16292b83 100644
42
55
raise ValueError(msg)
43
56
- return resource.bytes
44
57
+ return WRAPPERS[name]
45
-
58
+
46
59
# Public API follows
47
-
60
+
0 commit comments