]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix NULL test in _testinternalcapi (GH-92861)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 17 May 2022 01:54:47 +0000 (18:54 -0700)
committerGitHub <noreply@github.com>
Tue, 17 May 2022 01:54:47 +0000 (18:54 -0700)
(cherry picked from commit 702e0da000bf28aa20cb7f3893b575d977506495)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Modules/_testinternalcapi.c

index d5616fd59c6e500002dcadad01be66c3c3560e94..75e14efb7eb1526d0e3ee9ced14c8e97c93aaa0d 100644 (file)
@@ -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);