Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144169: Fix warning formatting in ast_type_init()#144177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
vstinner wants to merge1 commit intopython:mainfromvstinner:ast
Closed
Show file tree
Hide file tree
Changes fromall 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
4 changes: 4 additions & 0 deletionsLib/test/test_ast/test_ast.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -489,6 +489,10 @@ def test_classattrs(self):
# Arbitrary keyword arguments are supported (but deprecated)
with self.assertWarns(DeprecationWarning):
self.assertEqual(ast.Constant(1, foo='bar').foo, 'bar')
# gh-144169: non-string keys must not crash
with self.assertWarns(DeprecationWarning):
with self.assertRaises(TypeError):
ast.Constant(1, **{object(): 'bar'})

with self.assertRaisesRegex(TypeError, "Constant got multiple values for argument 'value'"):
ast.Constant(1, value=2)
Expand Down
2 changes: 1 addition & 1 deletionParser/asdl_c.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -965,7 +965,7 @@ def visitModule(self, mod):
else if (contains == 0) {
if (PyErr_WarnFormat(
PyExc_DeprecationWarning, 1,
"%.400s.__init__ got an unexpected keyword argument'%U'. "
"%.400s.__init__ got an unexpected keyword argument%R. "
"Support for arbitrary keyword arguments is deprecated "
"and will be removed in Python 3.15.",
Py_TYPE(self)->tp_name, key
Expand Down
2 changes: 1 addition & 1 deletionPython/Python-ast.c
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

Loading

[8]ページ先頭

©2009-2026 Movatter.jp