From 4c5a68ff03ff907c8a646492e3ca4997c9e1dceb Mon Sep 17 00:00:00 2001 From: Joseph Brill <48932340+jcbrill@users.noreply.github.com> Date: Sun, 15 Oct 2023 12:43:23 -0400 Subject: Internal updates to MSCommon/MSVC/Util.py and MSCommon/MSVC/Config.py. 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). --- SCons/Tool/MSCommon/MSVC/Config.py | 3 +-- SCons/Tool/MSCommon/MSVC/Util.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/SCons/Tool/MSCommon/MSVC/Config.py b/SCons/Tool/MSCommon/MSVC/Config.py index 29d6f24..7c0f1fe 100644 --- a/SCons/Tool/MSCommon/MSVC/Config.py +++ b/SCons/Tool/MSCommon/MSVC/Config.py @@ -29,8 +29,6 @@ from collections import ( namedtuple, ) -from . import Util - from .Exceptions import ( MSVCInternalError, ) @@ -319,6 +317,7 @@ MSVC_SDK_VERSIONS = [str(f) for f in sorted([float(s) for s in MSVC_SDK_VERSIONS def verify(): + from . import Util from .. import vc for msvc_version in vc._VCVER: if msvc_version not in MSVC_VERSION_SUFFIX: diff --git a/SCons/Tool/MSCommon/MSVC/Util.py b/SCons/Tool/MSCommon/MSVC/Util.py index 8afe784..6fd188b 100644 --- a/SCons/Tool/MSCommon/MSVC/Util.py +++ b/SCons/Tool/MSCommon/MSVC/Util.py @@ -43,7 +43,7 @@ from . import Config _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): """ @@ -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()) -- cgit v0.12