Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix stacklevel
  • Loading branch information
JelleZijlstra committed May 10, 2024
commit b022ddc422d7f743b169567426c21b5557ec6b1b
3 changes: 2 additions & 1 deletion Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6354,8 +6354,9 @@ def test_deprecation_for_no_type_params_passed_to__evaluate(self):

def test_collect_parameters(self):
typing = import_helper.import_fresh_module("typing")
with self.assertWarns(DeprecationWarning):
with self.assertWarns(DeprecationWarning) as cm:
Comment thread
JelleZijlstra marked this conversation as resolved.
Outdated
typing._collect_parameters
self.assertEqual(cm.filename, __file__)


@lru_cache()
Expand Down
2 changes: 1 addition & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3778,7 +3778,7 @@ def __getattr__(attr):
" removed in a future version of Python. Any use of private functions"
" is discouraged and may break in the future."
)
warnings.warn(depr_message, category=DeprecationWarning, stacklevel=1)
warnings.warn(depr_message, category=DeprecationWarning, stacklevel=2)
obj = _collect_type_parameters
else:
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
Expand Down