diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-12-31 11:04:16 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-12-31 11:04:16 +0100 |
commit | 36f45ee2e6ef751b52bcb868fdf6f09617eafdb5 (patch) | |
tree | d529745ff082262865aa6a933ab323837467f4e9 /psutil/_common.py | |
parent | c687f99789d8bdd7efa0b9b4787ae67cf184884b (diff) | |
download | psutil-36f45ee2e6ef751b52bcb868fdf6f09617eafdb5.tar.gz |
move import on top of the file
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'psutil/_common.py')
-rw-r--r-- | psutil/_common.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/psutil/_common.py b/psutil/_common.py index 16d3b3b5..bec8333f 100644 --- a/psutil/_common.py +++ b/psutil/_common.py @@ -44,6 +44,8 @@ else: # can't take it from _common.py as this script is imported by setup.py PY3 = sys.version_info[0] == 3 PSUTIL_DEBUG = bool(os.getenv('PSUTIL_DEBUG', 0)) +if PSUTIL_DEBUG: + import inspect __all__ = [ # OS constants @@ -835,7 +837,6 @@ def print_color( def debug(msg): """If PSUTIL_DEBUG env var is set, print a debug message to stderr.""" if PSUTIL_DEBUG: - import inspect fname, lineno, func_name, lines, index = inspect.getframeinfo( inspect.currentframe().f_back) if isinstance(msg, Exception): |