mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merge 3.6 (issue #26182)
This commit is contained in:
commit
228722ad20
2 changed files with 7 additions and 3 deletions
|
@ -109,6 +109,8 @@ Core and Builtins
|
||||||
- Issue #26182: Raise DeprecationWarning when async and await keywords are
|
- Issue #26182: Raise DeprecationWarning when async and await keywords are
|
||||||
used as variable/attribute/class/function name.
|
used as variable/attribute/class/function name.
|
||||||
|
|
||||||
|
- Issue #26182: Fix ia refleak in code that raises DeprecationWarning.
|
||||||
|
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
|
@ -944,17 +944,19 @@ forbidden_name(struct compiling *c, identifier name, const node *n,
|
||||||
PyObject *message = PyUnicode_FromString(
|
PyObject *message = PyUnicode_FromString(
|
||||||
"'async' and 'await' will become reserved keywords"
|
"'async' and 'await' will become reserved keywords"
|
||||||
" in Python 3.7");
|
" in Python 3.7");
|
||||||
|
int ret;
|
||||||
if (message == NULL) {
|
if (message == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (PyErr_WarnExplicitObject(
|
ret = PyErr_WarnExplicitObject(
|
||||||
PyExc_DeprecationWarning,
|
PyExc_DeprecationWarning,
|
||||||
message,
|
message,
|
||||||
c->c_filename,
|
c->c_filename,
|
||||||
LINENO(n),
|
LINENO(n),
|
||||||
NULL,
|
NULL,
|
||||||
NULL) < 0)
|
NULL);
|
||||||
{
|
Py_DECREF(message);
|
||||||
|
if (ret < 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue