Skip to content

Commit af3f019

Browse files
committed
catch and ignore deprecation warnings that is produced when importing pkg_resources
1 parent 7f22f72 commit af3f019

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

easybuild/tools/systemtools.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@
5656
# pkg_resources is provided by the setuptools Python package,
5757
# which we really want to keep as an *optional* dependency
5858
try:
59-
import pkg_resources
59+
# catch & ignore deprecation warning when importing pkg_resources produced by setuptools
60+
with warnings.catch_warnings():
61+
warnings.simplefilter("ignore", UserWarning)
62+
import pkg_resources
6063
HAVE_PKG_RESOURCES = True
6164
except ImportError:
6265
HAVE_PKG_RESOURCES = False

0 commit comments

Comments
 (0)