summaryrefslogtreecommitdiff
path: root/pkg_resources
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-11-03 17:59:05 -0400
committerJason R. Coombs <jaraco@jaraco.com>2021-11-03 17:59:05 -0400
commit30f070eeb27a6477314a03fecbd7e4cc3ac4fd9e (patch)
treea3f710f0e4b897708c85e59ec895ac08c18d1403 /pkg_resources
parentdfbbf11be13ecf11f8ed7c1f00f7adba8e425afc (diff)
downloadpython-setuptools-git-30f070eeb27a6477314a03fecbd7e4cc3ac4fd9e.tar.gz
Move warning definition above implicit behavior on import. Fixes #2846.
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 3aafe652..4aece3c4 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -3244,6 +3244,15 @@ def _initialize(g=globals()):
)
+class PkgResourcesDeprecationWarning(Warning):
+ """
+ Base class for warning about deprecations in ``pkg_resources``
+
+ This class is not derived from ``DeprecationWarning``, and as such is
+ visible by default.
+ """
+
+
@_call_aside
def _initialize_master_working_set():
"""
@@ -3282,12 +3291,3 @@ def _initialize_master_working_set():
# match order
list(map(working_set.add_entry, sys.path))
globals().update(locals())
-
-
-class PkgResourcesDeprecationWarning(Warning):
- """
- Base class for warning about deprecations in ``pkg_resources``
-
- This class is not derived from ``DeprecationWarning``, and as such is
- visible by default.
- """