[Python-checkins] Fix NULL test in _testinternalcapi (GH-92861)

miss-islington webhook-mailer at python.org
Mon May 16 21:55:05 EDT 2022


https://github.com/python/cpython/commit/add8820df87958ca584c840ffbe436c5577e6533
commit: add8820df87958ca584c840ffbe436c5577e6533
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-05-16T18:54:47-07:00
summary:

Fix NULL test in _testinternalcapi (GH-92861)

(cherry picked from commit 702e0da000bf28aa20cb7f3893b575d977506495)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde at users.noreply.github.com>

files:
M Modules/_testinternalcapi.c

diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index d5616fd59c6e5..75e14efb7eb15 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -292,7 +292,7 @@ check_edit_cost(const char *a, const char *b, Py_ssize_t expected)
         goto exit;
     }
     b_obj = PyUnicode_FromString(b);
-    if (a_obj == NULL) {
+    if (b_obj == NULL) {
         goto exit;
     }
     Py_ssize_t result = _Py_UTF8_Edit_Cost(a_obj, b_obj, -1);



More information about the Python-checkins mailing list