From 12fc30ad45c83b43533f3cbdf0e1c1d9a4c5e684 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Thu, 25 Apr 2024 17:20:55 +0200 Subject: [PATCH] Align with master branch --- paste/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/paste/__init__.py b/paste/__init__.py index ac06d66..ec8b065 100644 --- a/paste/__init__.py +++ b/paste/__init__.py @@ -1,8 +1,13 @@ # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php + +import warnings + try: - import pkg_resources - pkg_resources.declare_namespace(__name__) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", category=DeprecationWarning) + import pkg_resources + pkg_resources.declare_namespace(__name__) except (AttributeError, ImportError): # don't prevent use of paste if pkg_resources isn't installed from pkgutil import extend_path