Skip to content

Commit

Permalink
Merge pull request #4418 from mwichmann/maint/util-cleanup
Browse files Browse the repository at this point in the history
Tweak Util module
  • Loading branch information
bdbaddog authored Sep 22, 2023
2 parents dbd616a + cb79fbb commit b34fc33
Show file tree
Hide file tree
Showing 14 changed files with 359 additions and 235 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
builds. Also add a simple filesystem-based locking protocol to try to
avoid the problem occuring.
- Update the first two chapters on building with SCons in the User Guide.
- Some cleanup to the Util package, including renaming SCons.Util.types
to SCons.Util.sctypes to avoid any possible confusion with the
Python stdlib types module.
- TeX tests: skip tests that use makeindex or epstopdf not installed, or
if `kpsewhich glossaries.sty` fails.

Expand Down
6 changes: 6 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
The "--warn=missing-sconscript" commandline option is no longer available
as the warning was part of the transitional phase.
- Add missing directories to searched paths for mingw installs
- SCons.Util.types renamed to to SCons.Util.sctypes to avoid any possible
confusion with the Python stdlib "types" module. Note that it was briefly
(for 4.5.x only) possible to import directly from SCons.Util.types,
although the preferred usage remains to import from SCons.Util only.
Any code that did the direct import will have to change to import from
SCons.Util.sctypes.

FIXES
-----
Expand Down
7 changes: 4 additions & 3 deletions SCons/Errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"""

import shutil
import SCons.Util

from SCons.Util.sctypes import to_String, is_String

# Note that not all Errors are defined here, some are at the point of use

Expand Down Expand Up @@ -77,7 +78,7 @@ def __init__(self,

# py3: errstr should be string and not bytes.

self.errstr = SCons.Util.to_String(errstr)
self.errstr = to_String(errstr)
self.status = status
self.exitstatus = exitstatus
self.filename = filename
Expand Down Expand Up @@ -189,7 +190,7 @@ def convert_to_BuildError(status, exc_info=None):
status=2,
exitstatus=2,
exc_info=exc_info)
elif SCons.Util.is_String(status):
elif is_String(status):
buildError = BuildError(
errstr=status,
status=2,
Expand Down
2 changes: 1 addition & 1 deletion SCons/Node/FS.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ def islink(self, path) -> bool:

if hasattr(os, 'readlink'):

def readlink(self, file):
def readlink(self, file) -> str:
return os.readlink(file)

else:
Expand Down
Loading

0 comments on commit b34fc33

Please sign in to comment.