Skip to content

Commit 1ebdba5

Browse files
brondsemabravalheri
authored andcommitted
Use issue_warning helper to get best stacklevel (sometimes it could point to ResourceManager.resource_filename not user code)
1 parent 500f0a5 commit 1ebdba5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg_resources/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,10 +1661,9 @@ def _validate_resource_path(path):
16611661

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

16701669
def _get(self, path):

0 commit comments

Comments
 (0)