Skip to content

Commit cd1742b

Browse files
committed
Python 3.14 fix for Windows
Apparently, some of the bytecode strings now have system-specific differences - tiny ones, but enough to fail ActionTests. We dont have CI set up runnon Pyton 3.14 yet, neither Linux nor Windows, but I have tested on a Windows 11 system with 3.14.0a7 Signed-off-by: Mats Wichmann <[email protected]>
1 parent 06942c2 commit cd1742b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

SCons/ActionTests.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,11 @@ def func1(a, b, c):
22552255
(3, 11): (bytearray(b'3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()'),),
22562256
(3, 12): (bytearray(b'3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()'),),
22572257
(3, 13): (bytearray(b'3, 3, 0, 0,(),(),(\x95\x00U\x00$\x00),(),()'),),
2258-
(3, 14): (bytearray(b'3, 3, 0, 0,(),(),(\x80\x00R\x00"\x00),(),()'),),
2258+
(3, 14): (bytearray(
2259+
b'3, 3, 0, 0,(),(),(\x80\x00T\x00"\x00),(),()'
2260+
if sys.platform == 'win32'
2261+
else b'3, 3, 0, 0,(),(),(\x80\x00R\x00"\x00),(),()'
2262+
),),
22592263
}
22602264

22612265
c = SCons.Action._function_contents(func1)
@@ -2295,12 +2299,12 @@ def test_object_contents(self) -> None:
22952299
b"{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x95\x00S\x01U\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00S\x02U\x00l\x01\x00\x00\x00\x00\x00\x00\x00\x00g\x00),(),(),2, 2, 0, 0,(),(),(\x95\x00g\x00),(),()}}{{{a=a,b=b}}}"
22962300
),
22972301
(3, 14): bytearray(
2298-
b'{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x80\x00P\x00R\x00j\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x01R\x00j\x01\x00\x00\x00\x00\x00\x00\x00\x00P\x02"\x00),(),(),2, 2, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()}}{{{a=a,b=b}}}'
2302+
b'{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x80\x00P\x00T\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x01T\x00l\x01\x00\x00\x00\x00\x00\x00\x00\x00P\x02"\x00),(),(),2, 2, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()}}{{{a=a,b=b}}}'
2303+
if sys.platform == 'win32'
2304+
else b'{TestClass:__main__}[[[(<class \'object\'>, ()), [(<class \'__main__.TestClass\'>, (<class \'object\'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x80\x00P\x00R\x00j\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x01R\x00j\x01\x00\x00\x00\x00\x00\x00\x00\x00P\x02"\x00),(),(),2, 2, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()}}{{{a=a,b=b}}}'
22992305
),
23002306
}
2301-
2302-
# self.assertEqual(c, expected[sys.version_info[:2]])
2303-
assert c == expected[sys.version_info[:2]], c
2307+
self.assertEqual(c, expected[sys.version_info[:2]])
23042308

23052309
def test_code_contents(self) -> None:
23062310
"""Test that Action._code_contents works"""
@@ -2332,7 +2336,9 @@ def test_code_contents(self) -> None:
23322336
b'0, 0, 0, 0,(Hello, World!),(print),(\x95\x00\\\x00"\x00S\x005\x01\x00\x00\x00\x00\x00\x00 \x00g\x01)'
23332337
),
23342338
(3, 14): bytearray(
2335-
b'0, 0, 0, 0,(Hello, World!),(print),(\x80\x00Y\x00 \x00P\x002\x01\x00\x00\x00\x00\x00\x00\x1e\x00P\x01"\x00)'
2339+
b'0, 0, 0, 0,(Hello, World!),(print),(\x80\x00[\x00 \x00P\x002\x01\x00\x00\x00\x00\x00\x00\x1e\x00P\x01"\x00)'
2340+
if sys.platform == 'win32'
2341+
else b'0, 0, 0, 0,(Hello, World!),(print),(\x80\x00Y\x00 \x00P\x002\x01\x00\x00\x00\x00\x00\x00\x1e\x00P\x01"\x00)'
23362342
),
23372343
}
23382344

0 commit comments

Comments
 (0)