There was an error while loading. Please reload this page.
1 parent d9c3672 commit 54b6192Copy full SHA for 54b6192
1 file changed
Objects/codeobject.c
@@ -1849,12 +1849,13 @@ _PyCode_GetVarCounts(PyCodeObject *co, _PyCode_var_counts_t *counts)
1849
assert(numfree == co->co_nfreevars);
1850
1851
// Get the unbound counts.
1852
- assert(PyTuple_GET_SIZE(co->co_names) >= 0);
+ int numunbound = PyTuple_GET_SIZE(co->co_names);
1853
+ assert(numunbound >= 0);
1854
struct co_unbound_counts unbound = {
- .total = (int)PyTuple_GET_SIZE(co->co_names),
1855
+ .total = numunbound,
1856
// numglobal and numattrs can be set later
1857
// with _PyCode_SetUnboundVarCounts().
- .numunknown = (int)PyTuple_GET_SIZE(co->co_names),
1858
+ .numunknown = numunbound,
1859
};
1860
1861
// "Return" the result.
0 commit comments