Skip to content

Commit 2476f2f

Browse files
committed
_deprecated_config_handler(): Use warn stacklevel for better feedback (#3884)
2 parents b85c164 + b86aec3 commit 2476f2f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.d/change.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add a `stacklevel` parameter to `warnings.warn()` to provide more information to the user.
2+
-- by :user:`cclauss`

setuptools/config/setupcfg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def _deprecated_config_handler(self, func, msg, warning_class):
513513

514514
@wraps(func)
515515
def config_handler(*args, **kwargs):
516-
warnings.warn(msg, warning_class)
516+
warnings.warn(msg, warning_class, stacklevel=2)
517517
return func(*args, **kwargs)
518518

519519
return config_handler

0 commit comments

Comments
 (0)