MCPcopy Index your code
hub / github.com/pythonprofilers/memory_profiler / _find_script

Function _find_script

memory_profiler.py:487–503  ·  view source on GitHub ↗

Find the script. If the input is not a file, then $PATH will be searched.

(script_name)

Source from the content-addressed store, hash-verified

485
486
487def _find_script(script_name):
488 """ Find the script.
489
490 If the input is not a file, then $PATH will be searched.
491 """
492 if os.path.isfile(script_name):
493 return script_name
494 path = os.getenv('PATH', os.defpath).split(os.pathsep)
495 for folder in path:
496 if not folder:
497 continue
498 fn = os.path.join(folder, script_name)
499 if os.path.isfile(fn):
500 return fn
501
502 sys.stderr.write('Could not find script {0}\n'.format(script_name))
503 raise SystemExit(1)
504
505
506class _TimeStamperCM(object):

Callers 1

memory_profiler.pyFile · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected