diff options
| author | Neil Girdhar <mistersheik@gmail.com> | 2021-07-19 14:33:18 -0400 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-07-19 20:58:55 +0200 |
| commit | 40629baba2de2c9eb5e11b65798b3fae79f7284a (patch) | |
| tree | 9799e4a54a1c5cd7628508334eb29670bd0d5323 /astroid | |
| parent | b25c6d8880c41a6053bfd2ee9d47ffc875b3be38 (diff) | |
| download | astroid-git-40629baba2de2c9eb5e11b65798b3fae79f7284a.tar.gz | |
Add setuptools dependence and related guard
Diffstat (limited to 'astroid')
| -rw-r--r-- | astroid/interpreter/_import/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/astroid/interpreter/_import/util.py b/astroid/interpreter/_import/util.py index a917bd3d..eff54c3e 100644 --- a/astroid/interpreter/_import/util.py +++ b/astroid/interpreter/_import/util.py @@ -7,4 +7,8 @@ except ImportError: def is_namespace(modname): - return pkg_resources is not None and modname in pkg_resources._namespace_packages + return ( + pkg_resources is not None + and hasattr(pkg_resources, "_namespace_packages") + and modname in pkg_resources._namespace_packages + ) |
