Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.d/3920.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add a link to deprecation warning in ``pkg_resources`` and improve
``stacklevel`` for better visibility.
7 changes: 4 additions & 3 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
_namespace_packages = None


warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
warnings.warn("pkg_resources is deprecated as an API. "
"See https://setuptools.pypa.io/en/latest/pkg_resources.html",
DeprecationWarning, stacklevel=2)


_PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.I)
Expand Down Expand Up @@ -1659,10 +1661,9 @@ def _validate_resource_path(path):

# for compatibility, warn; in future
# raise ValueError(msg)
warnings.warn(
issue_warning(
msg[:-1] + " and will raise exceptions in a future release.",
DeprecationWarning,
stacklevel=4,
)

def _get(self, path):
Expand Down