summaryrefslogtreecommitdiff
path: root/psutil/_common.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-11 23:04:38 +0100
committerGitHub <noreply@github.com>2020-02-11 23:04:38 +0100
commit9e2ca978b211993066b0dc41da9aa63429655406 (patch)
treecb46fc9c1d42d7681a79be303292ee47b33d40b9 /psutil/_common.py
parentd8cb832f8cc7ef2695472ec0f752c59c72916274 (diff)
downloadpsutil-9e2ca978b211993066b0dc41da9aa63429655406.tar.gz
Add support for PyPy on Windows (#1686)
Diffstat (limited to 'psutil/_common.py')
-rw-r--r--psutil/_common.py8
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