Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
that can be rendered by Sphinx, and updating that text. The rest is
minor fiddling like switching to f-strings small doc changes.
- Fix a couple of unit tests to not fail with Python 3.14. These involve
bytecode and error message contents, and there was no problem with
SCons itself using 3.14 in its current (just-before-freeze) state.
bytecode strings and error message contents; there was no problem with
SCons itself using 3.14. Since 3.14 is now in Beta, there should
be no further changes.
- Replace use of old conditional expression idioms with the official
one from PEP 308 introduced in Python 2.5 (2006). The idiom being
replaced (using and/or) is regarded as error prone.
Expand Down
5 changes: 3 additions & 2 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ DEVELOPMENT

- Clean up C and C++ FLAGS tests. Tests which use a real compiler
are now more clearly distinguished (-live.py suffix and docstring).

- Fix a couple of unit tests to not fail with Python 3.14. These involve
expectations for bytecode and error message contents; there was no problem
with SCons itself using 3.14 in its current (just-before-freeze) state.
expectations for bytecode strings and error message contents; there was
no problem with SCons itself using 3.14.

Thanks to the following contributors listed below for their contributions to this release.
==========================================================================================
Expand Down
43 changes: 14 additions & 29 deletions SCons/ActionTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __call__(self) -> None:
from unittest import mock
from subprocess import PIPE
from typing import TYPE_CHECKING
if 'unittest.util' in __import__('sys').modules:
Comment thread
bdbaddog marked this conversation as resolved.
Outdated
__import__('sys').modules['unittest.util']._MAX_LENGTH = 99999999

import SCons.Action
import SCons.Environment
Expand Down Expand Up @@ -1552,7 +1554,7 @@ def LocalFunc() -> None:
(3, 11): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()'),
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
}

meth_matches = [
Expand Down Expand Up @@ -1733,7 +1735,7 @@ def LocalFunc() -> None:
(3, 11): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()'),
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),

}

Expand All @@ -1745,7 +1747,7 @@ def LocalFunc() -> None:
(3, 11): bytearray(b'1, 1, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
(3, 12): bytearray(b'1, 1, 0, 0,(),(),(\x97\x00y\x00),(),()'),
(3, 13): bytearray(b'1, 1, 0, 0,(),(),(\x95\x00g\x00),(),()'),
(3, 14): bytearray(b'1, 1, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()'),
(3, 14): bytearray(b'1, 1, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
}

def factory(act, **kw):
Expand Down Expand Up @@ -1986,7 +1988,7 @@ def LocalFunc() -> None:
(3, 11): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00d\x00S\x00),(),()'),
(3, 12): bytearray(b'0, 0, 0, 0,(),(),(\x97\x00y\x00),(),()'),
(3, 13): bytearray(b'0, 0, 0, 0,(),(),(\x95\x00g\x00),(),()'),
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00P\x00"\x00),(),()'),
(3, 14): bytearray(b'0, 0, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()'),
}

meth_matches = [
Expand Down Expand Up @@ -2049,7 +2051,7 @@ def LocalFunc() -> None:
(3, 11): b'\x97\x00d\x00S\x00',
(3, 12): b'\x97\x00y\x00',
(3, 13): b'\x95\x00g\x00',
(3, 14): b'\x80\x00P\x00"\x00',
(3, 14): b'\x80\x00R\x00#\x00',
}

with self.subTest():
Expand Down Expand Up @@ -2255,14 +2257,7 @@ def func1(a, b, c):
(3, 11): (bytearray(b"3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()"),),
(3, 12): (bytearray(b"3, 3, 0, 0,(),(),(\x97\x00|\x00S\x00),(),()"),),
(3, 13): (bytearray(b"3, 3, 0, 0,(),(),(\x95\x00U\x00$\x00),(),()"),),
(3, 14): (
bytearray(
b'3, 3, 0, 0,(),(),(\x80\x00T\x00"\x00),(),()'
), # win32 has different bytecodes
bytearray(
b'3, 3, 0, 0,(),(),(\x80\x00R\x00"\x00),(),()'
), # every other OS?
),
(3, 14): (bytearray(b"3, 3, 0, 0,(),(),(\x80\x00V\x00#\x00),(),()"),),
}

c = SCons.Action._function_contents(func1)
Expand Down Expand Up @@ -2301,16 +2296,11 @@ def test_object_contents(self) -> None:
(3, 13): bytearray(
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}}}"
),
(3, 14): (
bytearray(
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}}}"
), # win32
bytearray(
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}}}"
),
(3, 14): bytearray(
b"{TestClass:__main__}[[[(<class 'object'>, ()), [(<class '__main__.TestClass'>, (<class 'object'>,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x80\x00R\x00V\x00n\x00\x00\x00\x00\x00\x00\x00\x00\x00R\x01V\x00n\x01\x00\x00\x00\x00\x00\x00\x00\x00R\x02#\x00),(),(),2, 2, 0, 0,(),(),(\x80\x00R\x00#\x00),(),()}}{{{a=a,b=b}}}"
),
}
self.assertTrue(c in expected[sys.version_info[:2]])
self.assertEqual(c, expected[sys.version_info[:2]])

def test_code_contents(self) -> None:
"""Test that Action._code_contents works"""
Expand Down Expand Up @@ -2341,17 +2331,12 @@ def test_code_contents(self) -> None:
(3, 13): bytearray(
b'0, 0, 0, 0,(Hello, World!),(print),(\x95\x00\\\x00"\x00S\x005\x01\x00\x00\x00\x00\x00\x00 \x00g\x01)'
),
(3, 14): (
bytearray(
b'0, 0, 0, 0,(Hello, World!),(print),(\x80\x00[\x00 \x00P\x002\x01\x00\x00\x00\x00\x00\x00\x1e\x00P\x01"\x00)'
), # win32
bytearray(
b'0, 0, 0, 0,(Hello, World!),(print),(\x80\x00Y\x00 \x00P\x002\x01\x00\x00\x00\x00\x00\x00\x1e\x00P\x01"\x00)'
),
(3, 14): bytearray(
b"0, 0, 0, 0,(Hello, World!),(print),(\x80\x00]\x00!\x00R\x004\x01\x00\x00\x00\x00\x00\x00\x1f\x00R\x01#\x00)"
),
}

self.assertTrue(c in expected[sys.version_info[:2]],f"\nExpected:{expected[sys.version_info[:2]]}\nGot :{c}")
self.assertEqual(c, expected[sys.version_info[:2]])

def test_uncaught_exception_bubbles(self):
"""Test that scons_subproc_run bubbles uncaught exceptions"""
Expand Down
Loading