diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-14 22:14:53 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-14 22:14:53 +0200 |
commit | e91bae62e6e6ee9c3ad27c1fe3013f929309e1b0 (patch) | |
tree | 9e897a5be67cfcf8356c8e2d616b0dc47ca794ad /psutil/_common.py | |
parent | 4d03c917561297de1e6017059c60eb879cf8353c (diff) | |
download | psutil-e91bae62e6e6ee9c3ad27c1fe3013f929309e1b0.tar.gz |
add debug() prints in a couple of places
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'psutil/_common.py')
-rw-r--r-- | psutil/_common.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/psutil/_common.py b/psutil/_common.py index 879e8477..a2b8bab6 100644 --- a/psutil/_common.py +++ b/psutil/_common.py @@ -836,6 +836,8 @@ if bool(os.getenv('PSUTIL_DEBUG', 0)): """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) + if isinstance(msg, Exception): + msg = "ignoring %s" % msg print("psutil-debug [%s:%s]> %s" % (fname, lineno, msg), # NOQA file=sys.stderr) else: |