Skip to content

Commit

Permalink
Internal updates to MSCommon/MSVC/Util.py and MSCommon/MSVC/Config.py.
Browse files Browse the repository at this point in the history
Changes:
* Adjust os path separators in MSCommon/MSVC/Util.py
* Revise commend inside resolve_path method in in MSCommon/MSVC/Util.py
* Move Util import inside verify method in MSCommon/MSVC/Config.py (prevent import dependency loops).
  • Loading branch information
jcbrill committed Oct 15, 2023
1 parent 8365968 commit 4c5a68f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions SCons/Tool/MSCommon/MSVC/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
namedtuple,
)

from . import Util

from .Exceptions import (
MSVCInternalError,
)
Expand Down Expand Up @@ -319,6 +317,7 @@


def verify():
from . import Util
from .. import vc
for msvc_version in vc._VCVER:
if msvc_version not in MSVC_VERSION_SUFFIX:
Expand Down
8 changes: 4 additions & 4 deletions SCons/Tool/MSCommon/MSVC/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
_RE_DRIVESPEC = re.compile(r'^[A-Za-z][:]$', re.IGNORECASE)

# windows path separators
_OS_PATH_SEPS = ('\\', '/')
_OS_PATH_SEPS = (os.path.sep, os.path.altsep) if os.path.altsep else (os.path.sep,)

def listdir_dirs(p):
"""
Expand Down Expand Up @@ -87,9 +87,9 @@ def resolve_path(p, ignore_drivespec=True):
# don't attempt to resolve drive specification (e.g., C:)
pass
else:
# both abspath and resolve necessary to produce identical path
# when (unqualified) file name is on a mapped network drive for
# python 3.6 and 3.11
# both abspath and resolve necessary for an unqualified file name
# on a mapped network drive in order to return a mapped drive letter
# path rather than a UNC path.
p = os.path.abspath(p)
try:
p = str(pathlib.Path(p).resolve())
Expand Down

0 comments on commit 4c5a68f

Please sign in to comment.