diff options
| -rw-r--r-- | changelog.d/2486.misc.rst | 1 | ||||
| -rw-r--r-- | pkg_resources/__init__.py | 18 |
2 files changed, 10 insertions, 9 deletions
diff --git a/changelog.d/2486.misc.rst b/changelog.d/2486.misc.rst new file mode 100644 index 00000000..6a2c4438 --- /dev/null +++ b/changelog.d/2486.misc.rst @@ -0,0 +1 @@ +Move PkgResourcesDeprecationWarning above implicitly-called function so that it's in the namespace when version warnings are generated in an environment that contains them. 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. - """ |
