Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
need actual installed system programs (add -live suffix).
- Test runner reworked to use Python logging; the portion of the test suite
which tests the runner was adjusted to match.
- Switch remaining "original style" docstring parameter listings to
Google style.


RELEASE 4.10.1 - Sun, 16 Nov 2025 10:51:57 -0700
Expand Down
2 changes: 2 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ IMPROVEMENTS

- Used Gemini to refactor runtest.py to better organized the code and add docstrings.

- Switch remaining "original style" docstring parameter listings to Google style.


PACKAGING
---------
Expand Down
8 changes: 4 additions & 4 deletions SCons/Action.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ def _object_instance_content(obj):
"""
Returns consistant content for a action class or an instance thereof

:Parameters:
- `obj` Should be either and action class or an instance thereof
Args:
obj: Should be either an action class or an instance thereof

:Returns:
bytearray or bytes representing the obj suitable for generating a signature from.
Returns:
bytearray or bytes representing the obj suitable for generating a signature from.
"""
retval = bytearray()

Expand Down
26 changes: 12 additions & 14 deletions SCons/Conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,11 @@ def _YesNoResult(context, ret, key, text, comment = None) -> None:
r"""
Handle the result of a test with a "yes" or "no" result.

:Parameters:
- `ret` is the return value: empty if OK, error message when not.
- `key` is the name of the symbol to be defined (HAVE_foo).
- `text` is the source code of the program used for testing.
- `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
Args:
ret: the return value, empty if OK, error message when not.
key: the name of the symbol to be defined (HAVE_foo).
text: the source code of the program used for testing.
comment: the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
"""
if key:
_Have(context, key, not ret, comment)
Expand All @@ -784,19 +784,17 @@ def _Have(context, key, have, comment = None) -> None:
r"""
Store result of a test in context.havedict and context.headerfilename.

:Parameters:
- `key` - is a "HAVE_abc" name. It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.
- `have` - value as it should appear in the header file, include quotes when desired and escape special characters!
- `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
Args:
key: a "HAVE_abc" name. It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.
have: value as it should appear in the header file, include quotes when desired and escape special characters!
comment: is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.


The value of "have" can be:
- 1 - Feature is defined, add "#define key".
- 0 - Feature is not defined, add "/\* #undef key \*/". Adding "undef" is what autoconf does. Not useful for the compiler, but it shows that the test was done.
- number - Feature is defined to this number "#define key have". Doesn't work for 0 or 1, use a string then.
- string - Feature is defined to this string "#define key have".


"""
key_up = key.upper()
key_up = re.sub('[^A-Z0-9_]', '_', key_up)
Expand Down Expand Up @@ -849,9 +847,9 @@ def _lang2suffix(lang):
For an unrecognized language returns (None, None, msg).

Where:
- lang = the unified language name
- suffix = the suffix, including the leading dot
- msg = an error message
lang: the unified language name
suffix: the suffix, including the leading dot
msg: an error message
"""
if not lang or lang in ["C", "c"]:
return ("C", ".c", None)
Expand Down
27 changes: 17 additions & 10 deletions SCons/Defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import SCons.CacheDir
import SCons.Environment
import SCons.Errors
import SCons.Node.FS
import SCons.PathList
import SCons.Scanner.Dir
import SCons.Subst
Expand Down Expand Up @@ -606,7 +607,7 @@ def processDefines(defs) -> list[str]:
# TODO: do we need to quote value if it contains space?
dlist.append(f"{name}={value[0]}")
else:
dlist.append(str(define[0]))
dlist.append(str(defs[0]))
elif is_Dict(defs):
for macro, value in defs.items():
if value is None:
Expand Down Expand Up @@ -685,10 +686,13 @@ def __call__(self, *args, **kw):
def __libversionflags(env, version_var, flags_var):
"""
if version_var is not empty, returns env[flags_var], otherwise returns None
:param env:
:param version_var:
:param flags_var:
:return:

Args:
env:
version_var:
flags_var:

Returns:
"""
try:
if env.subst('$' + version_var):
Expand All @@ -701,11 +705,14 @@ def __libversionflags(env, version_var, flags_var):
def __lib_either_version_flag(env, version_var1, version_var2, flags_var):
"""
if $version_var1 or $version_var2 is not empty, returns env[flags_var], otherwise returns None
:param env:
:param version_var1:
:param version_var2:
:param flags_var:
:return:

Args:
env:
version_var1:
version_var2:
flags_var:

Returns:
"""
try:
if env.subst('$' + version_var1) or env.subst('$' + version_var2):
Expand Down
Loading
Loading