[Python-checkins] gh-103826: fix unused variable warning introduced in gh-102343 (#103825)
kumaraditya303
webhook-mailer at python.org
Tue Apr 25 06:01:22 EDT 2023
https://github.com/python/cpython/commit/0acea96dad622cba41bf1e9ee25d87658579ba88
commit: 0acea96dad622cba41bf1e9ee25d87658579ba88
branch: main
author: sunmy2019 <59365878+sunmy2019 at users.noreply.github.com>
committer: kumaraditya303 <59607654+kumaraditya303 at users.noreply.github.com>
date: 2023-04-25T15:31:04+05:30
summary:
gh-103826: fix unused variable warning introduced in gh-102343 (#103825)
files:
M Objects/typeobject.c
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 07c900932b4c..09ea566ee143 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6706,7 +6706,6 @@ type_ready_mro(PyTypeObject *type)
and static builtin types must have static builtin bases. */
if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
assert(type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE);
- int isbuiltin = type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN;
PyObject *mro = type->tp_mro;
Py_ssize_t n = PyTuple_GET_SIZE(mro);
for (Py_ssize_t i = 0; i < n; i++) {
@@ -6718,7 +6717,8 @@ type_ready_mro(PyTypeObject *type)
type->tp_name, base->tp_name);
return -1;
}
- assert(!isbuiltin || (base->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN));
+ assert(!(type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN) ||
+ (base->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN));
}
}
return 0;
More information about the Python-checkins
mailing list