MCPcopy Index your code
hub / github.com/RustPython/RustPython / abspath

Function abspath

Lib/posixpath.py:373–382  ·  view source on GitHub ↗

Return an absolute path.

(path)

Source from the content-addressed store, hash-verified

371
372
373def abspath(path):
374 """Return an absolute path."""
375 path = os.fspath(path)
376 if isinstance(path, bytes):
377 if not path.startswith(b'/'):
378 path = join(os.getcwdb(), path)
379 else:
380 if not path.startswith('/'):
381 path = join(os.getcwd(), path)
382 return normpath(path)
383
384
385# Return a canonical path (i.e. the absolute location of a file on the

Callers 2

test_posixpath.pyFile · 0.90
relpathFunction · 0.70

Calls 4

normpathFunction · 0.90
isinstanceFunction · 0.85
joinFunction · 0.70
startswithMethod · 0.45

Tested by

no test coverage detected