Skip to content

Commit 5efb7e2

Browse files
committed
Add mypy ignores and docstrings to modutils and util.py
1 parent e840a7c commit 5efb7e2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

astroid/interpreter/_import/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
try:
66
import pkg_resources
77
except ImportError:
8-
pkg_resources = None
8+
pkg_resources = None # type: ignore[assignment]
99

1010

1111
def is_namespace(modname):

astroid/modutils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
try:
8989
# real_prefix is defined when running inside virtual environments,
9090
# created with the **virtualenv** library.
91-
STD_LIB_DIRS.add(os.path.join(sys.real_prefix, "dlls"))
91+
# Deprecated in virtualenv==16.7.9
92+
# See: https://github.com/pypa/virtualenv/issues/1622
93+
STD_LIB_DIRS.add(os.path.join(sys.real_prefix, "dlls")) # type: ignore[attr-defined]
9294
except AttributeError:
9395
# sys.base_exec_prefix is always defined, but in a virtual environment
9496
# created with the stdlib **venv** module, it points to the original
@@ -120,10 +122,12 @@
120122
pass
121123
del _root
122124
if os.name == "posix":
123-
# Need the real prefix is we're under a virtualenv, otherwise
125+
# Need the real prefix if we're in a virtualenv, otherwise
124126
# the usual one will do.
127+
# Deprecated in virtualenv==16.7.9
128+
# See: https://github.com/pypa/virtualenv/issues/1622
125129
try:
126-
prefix = sys.real_prefix
130+
prefix = sys.real_prefix # type: ignore[attr-defined]
127131
except AttributeError:
128132
prefix = sys.prefix
129133

0 commit comments

Comments
 (0)