Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve conversion to BuildError #4532

Merged
merged 3 commits into from
May 19, 2024
Merged

Conversation

mwichmann
Copy link
Collaborator

In some cases, the conversion of another exception to a BuildError could yield undesired results: if the exception was a OSError/IOError, and some fields were initially set to None, then the return code and error string were set to None, rather than the SCons defaults (which are return code 2, and the string set originally in the exception).

A unit test is added which attempts to build an OSError in the way that the case "in the wild" does - confirmed failing to pick up defaults without the change.

Fixes #4530

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt (and read the README.rst)
  • I have updated the appropriate documentation

mwichmann and others added 3 commits May 16, 2024 13:08
In some cases, the conversion of another exception to a BuildError
could yield undesired results: if the exception was a OSError/IOError,
and some fields were initially set to None, then the return code and error
string were set to None, rather than the SCons defaults (which are
return code 2, and the string set originally in the exception).

A unit test is added which attempts to build an OSError in the way
that the case "in the wild" does - confirmed failing to pick up
defaults without the change.

Fixes SCons#4530

Signed-off-by: Mats Wichmann <[email protected]>
@bdbaddog bdbaddog merged commit 04c5b6e into SCons:master May 19, 2024
4 of 5 checks passed
@mwichmann mwichmann added this to the 4.8 milestone May 19, 2024
@mwichmann mwichmann deleted the exception-convert branch May 19, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCons may convert another exception to BuildError incorrectly
2 participants