@@ -1537,13 +1537,24 @@ code_getfreevars(PyCodeObject *code, void *closure)
1537
1537
return _PyCode_GetFreevars (code );
1538
1538
}
1539
1539
1540
+ static PyObject *
1541
+ code_getquickened (PyCodeObject * code , void * closure )
1542
+ {
1543
+ if (code -> co_quickened == NULL ) {
1544
+ Py_RETURN_NONE ;
1545
+ }
1546
+ return PyBytes_FromStringAndSize ((char * )code -> co_firstinstr ,
1547
+ PyBytes_Size (code -> co_code ));
1548
+ }
1549
+
1540
1550
static PyGetSetDef code_getsetlist [] = {
1541
1551
{"co_lnotab" , (getter )code_getlnotab , NULL , NULL },
1542
1552
// The following old names are kept for backward compatibility.
1543
1553
{"co_nlocals" , (getter )code_getnlocals , NULL , NULL },
1544
1554
{"co_varnames" , (getter )code_getvarnames , NULL , NULL },
1545
1555
{"co_cellvars" , (getter )code_getcellvars , NULL , NULL },
1546
1556
{"co_freevars" , (getter )code_getfreevars , NULL , NULL },
1557
+ {"_co_quickened" , (getter )code_getquickened , NULL , NULL },
1547
1558
{0 }
1548
1559
};
1549
1560
@@ -1902,7 +1913,7 @@ _PyCode_ConstantKey(PyObject *op)
1902
1913
return key ;
1903
1914
}
1904
1915
1905
- void
1916
+ void
1906
1917
_PyStaticCode_Dealloc (PyCodeObject * co )
1907
1918
{
1908
1919
if (co -> co_quickened ) {
@@ -1921,7 +1932,7 @@ _PyStaticCode_Dealloc(PyCodeObject *co)
1921
1932
}
1922
1933
1923
1934
void
1924
- _PyStaticCode_InternStrings (PyCodeObject * co )
1935
+ _PyStaticCode_InternStrings (PyCodeObject * co )
1925
1936
{
1926
1937
int res = intern_strings (co -> co_names );
1927
1938
assert (res == 0 );
0 commit comments