MCPcopy Index your code
hub / github.com/python/cpython / _find_script

Function _find_script

Tools/c-analyzer/c_common/scriptutil.py:50–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49
50def _find_script():
51 frame = sys._getframe(2)
52 while frame.f_globals['__name__'] != '__main__':
53 frame = frame.f_back
54
55 # This should match sys.argv[0].
56 filename = frame.f_globals['__file__']
57 # This will be None if -m wasn't used..
58 spec = frame.f_globals['__spec__']
59 return filename, spec
60
61
62def is_installed(filename, *, allowsuffix=True):

Callers 1

get_progFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…