Skip to content

Commit 40629ba

Browse files
NeilGirdharPierre-Sassoulas
authored andcommitted
Add setuptools dependence and related guard
1 parent b25c6d8 commit 40629ba

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Release date: TBA
2929

3030
Closes PyCQA/pylint#4715
3131

32+
* Add dependency on setuptools and a guard to prevent related exceptions.
33+
3234

3335
What's New in astroid 2.6.2?
3436
============================

astroid/interpreter/_import/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@
77

88

99
def is_namespace(modname):
10-
return pkg_resources is not None and modname in pkg_resources._namespace_packages
10+
return (
11+
pkg_resources is not None
12+
and hasattr(pkg_resources, "_namespace_packages")
13+
and modname in pkg_resources._namespace_packages
14+
)

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ packages = find:
3838
install_requires =
3939
lazy_object_proxy>=1.4.0
4040
wrapt>=1.11,<1.13
41+
setuptools>=56.0
4142
typed-ast>=1.4.0,<1.5;implementation_name=="cpython" and python_version<"3.8"
4243
typing-extensions>=3.7.4;python_version<"3.8"
4344
python_requires = ~=3.6

0 commit comments

Comments
 (0)