pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/b14e5df120ca8ce968a67df2e00e7a764dd703a0

9af82350aeda.css" /> gh-111789: Use PyDict_GetItemRef() in Modules/_csv.c (gh-112073) · python/cpython@b14e5df · GitHub
Skip to content

Commit b14e5df

Browse files
gh-111789: Use PyDict_GetItemRef() in Modules/_csv.c (gh-112073)
1 parent 4eea1e8 commit b14e5df

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Modules/_csv.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,9 @@ static PyObject *
160160
get_dialect_from_registry(PyObject *name_obj, _csvstate *module_state)
161161
{
162162
PyObject *dialect_obj;
163-
164-
dialect_obj = PyDict_GetItemWithError(module_state->dialects, name_obj);
165-
if (dialect_obj == NULL) {
166-
if (!PyErr_Occurred())
167-
PyErr_Format(module_state->error_obj, "unknown dialect");
163+
if (PyDict_GetItemRef(module_state->dialects, name_obj, &dialect_obj) == 0) {
164+
PyErr_SetString(module_state->error_obj, "unknown dialect");
168165
}
169-
else
170-
Py_INCREF(dialect_obj);
171-
172166
return dialect_obj;
173167
}
174168

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy