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

Function getabsfile

tools/python-3.11.9-amd64/Lib/inspect.py:957–964  ·  view source on GitHub ↗

Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.

(object, _filename=None)

Source from the content-addressed store, hash-verified

955 return filename
956
957def getabsfile(object, _filename=None):
958 """Return an absolute path to the source or compiled file for an object.
959
960 The idea is for each object to have a unique origin, so this routine
961 normalizes the result as much as possible."""
962 if _filename is None:
963 _filename = getsourcefile(object) or getfile(object)
964 return os.path.normcase(os.path.abspath(_filename))
965
966modulesbyfile = {}
967_filesbymodname = {}

Callers 1

getmoduleFunction · 0.85

Calls 2

getsourcefileFunction · 0.85
getfileFunction · 0.85

Tested by

no test coverage detected