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 | |
parent | c687f99789d8bdd7efa0b9b4787ae67cf184884b (diff) | |
download | psutil-36f45ee2e6ef751b52bcb868fdf6f09617eafdb5.tar.gz |
move import on top of the file
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | psutil/_common.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst index 2ac9c2ce..ef9d3c26 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2593,7 +2593,7 @@ If you want to develop psutil take a look at the `development guide`_. Platforms support history ========================= -* psutil 5.8.1 (2021-10): **MidnightBSD** +* psutil 5.9.0 (2021-12): **MidnightBSD** * psutil 5.8.0 (2020-12): **PyPy 2** on Windows * psutil 5.7.1 (2020-07): **Windows Nano** * psutil 5.7.0 (2020-02): drop Windows XP & Server 2003 support 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): |