Skip to content

Commit 1d6ccca

Browse files
committed
Add _w_long, _u_long to bootstrap which is requried by importlib
1 parent 49ed782 commit 1d6ccca

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

vm/Lib/_bootstrap_external.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
+ _CASE_INSENSITIVE_PLATFORMS_STR_KEY)
2727

2828

29+
def _w_long(x):
30+
"""Convert a 32-bit integer to little-endian."""
31+
return (int(x) & 0xFFFFFFFF).to_bytes(4, 'little')
32+
33+
34+
def _r_long(int_bytes):
35+
"""Convert 4 bytes in little-endian to an integer."""
36+
return int.from_bytes(int_bytes, 'little')
37+
38+
2939
def _make_relax_case():
3040
if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
3141
if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS_STR_KEY):

0 commit comments

Comments
 (0)