diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 23:04:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 23:04:38 +0100 |
commit | 9e2ca978b211993066b0dc41da9aa63429655406 (patch) | |
tree | cb46fc9c1d42d7681a79be303292ee47b33d40b9 /psutil/_common.py | |
parent | d8cb832f8cc7ef2695472ec0f752c59c72916274 (diff) | |
download | psutil-9e2ca978b211993066b0dc41da9aa63429655406.tar.gz |
Add support for PyPy on Windows (#1686)
Diffstat (limited to 'psutil/_common.py')
-rw-r--r-- | psutil/_common.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/psutil/_common.py b/psutil/_common.py index 453c771d..9306cd15 100644 --- a/psutil/_common.py +++ b/psutil/_common.py @@ -790,8 +790,14 @@ def hilite(s, ok=True, bold=False): if bool(os.getenv('PSUTIL_DEBUG', 0)): + import inspect + def debug(msg): - print("psutil-debug> " + msg, file=sys.stderr) + """If PSUTIL_DEBUG env var is set, print a debug message to stderr.""" + fname, lineno, func_name, lines, index = inspect.getframeinfo( + inspect.currentframe().f_back) + print("psutil-debug [%s:%s]> %s" % (fname, lineno, msg), + file=sys.stderr) else: def debug(msg): pass |