MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _abspath_fallback

Function _abspath_fallback

tools/python-3.11.9-amd64/Lib/ntpath.py:546–560  ·  view source on GitHub ↗

Return the absolute version of a path as a fallback function in case `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for more.

(path)

Source from the content-addressed store, hash-verified

544
545
546def _abspath_fallback(path):
547 """Return the absolute version of a path as a fallback function in case
548 `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
549 more.
550
551 """
552
553 path = os.fspath(path)
554 if not isabs(path):
555 if isinstance(path, bytes):
556 cwd = os.getcwdb()
557 else:
558 cwd = os.getcwd()
559 path = join(cwd, path)
560 return normpath(path)
561
562# Return an absolute path.
563try:

Callers 1

abspathFunction · 0.85

Calls 3

isabsFunction · 0.70
joinFunction · 0.70
normpathFunction · 0.70

Tested by

no test coverage detected