mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-35059: Cleanup usage of Python macros (GH-10648)
Don't pass complex expressions but regular variables to Python macros. * _datetimemodule.c: split single large "if" into two "if" in date_new(), time_new() and datetime_new(). * _pickle.c, load_extension(): flatten complex "if" expression into more regular C code. * _ssl.c: addbool() now uses a temporary bool_obj to only evaluate the value once. * weakrefobject.c: replace "Py_INCREF(result = proxy);" with "result = proxy; Py_INCREF(result);"
This commit is contained in:
parent
2ff8fb7639
commit
b37672daf6
4 changed files with 109 additions and 85 deletions
|
@ -833,7 +833,8 @@ PyWeakref_NewProxy(PyObject *ob, PyObject *callback)
|
|||
to avoid violating the invariants of the list
|
||||
of weakrefs for ob. */
|
||||
Py_DECREF(result);
|
||||
Py_INCREF(result = proxy);
|
||||
result = proxy;
|
||||
Py_INCREF(result);
|
||||
goto skip_insert;
|
||||
}
|
||||
prev = ref;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue