diff options
| author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-12-14 21:52:01 +0100 |
|---|---|---|
| committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-12-14 22:01:40 +0100 |
| commit | 5efb7e2ad30f7f0ee6c25f1407c555991730ae44 (patch) | |
| tree | 195fc51535d20ac9d9d84e4bdd9778ee32608450 | |
| parent | e840a7c54d3d8b5be2db1e66f34a5368c64fc3f7 (diff) | |
| download | astroid-git-5efb7e2ad30f7f0ee6c25f1407c555991730ae44.tar.gz | |
Add mypy ignores and docstrings to ``modutils`` and ``util.py``
| -rw-r--r-- | astroid/interpreter/_import/util.py | 2 | ||||
| -rw-r--r-- | astroid/modutils.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/astroid/interpreter/_import/util.py b/astroid/interpreter/_import/util.py index 2e8a00fa..6390aaf9 100644 --- a/astroid/interpreter/_import/util.py +++ b/astroid/interpreter/_import/util.py @@ -5,7 +5,7 @@ try: import pkg_resources except ImportError: - pkg_resources = None + pkg_resources = None # type: ignore[assignment] def is_namespace(modname): diff --git a/astroid/modutils.py b/astroid/modutils.py index ef8b39da..141b18a6 100644 --- a/astroid/modutils.py +++ b/astroid/modutils.py @@ -88,7 +88,9 @@ if os.name == "nt": try: # real_prefix is defined when running inside virtual environments, # created with the **virtualenv** library. - STD_LIB_DIRS.add(os.path.join(sys.real_prefix, "dlls")) + # Deprecated in virtualenv==16.7.9 + # See: https://github.com/pypa/virtualenv/issues/1622 + STD_LIB_DIRS.add(os.path.join(sys.real_prefix, "dlls")) # type: ignore[attr-defined] except AttributeError: # sys.base_exec_prefix is always defined, but in a virtual environment # created with the stdlib **venv** module, it points to the original @@ -120,10 +122,12 @@ if platform.python_implementation() == "PyPy": pass del _root if os.name == "posix": - # Need the real prefix is we're under a virtualenv, otherwise + # Need the real prefix if we're in a virtualenv, otherwise # the usual one will do. + # Deprecated in virtualenv==16.7.9 + # See: https://github.com/pypa/virtualenv/issues/1622 try: - prefix = sys.real_prefix + prefix = sys.real_prefix # type: ignore[attr-defined] except AttributeError: prefix = sys.prefix |
