@@ -1537,13 +1537,24 @@ code_getfreevars(PyCodeObject *code, void *closure)
15371537 return _PyCode_GetFreevars (code );
15381538}
15391539
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+
15401550static PyGetSetDef code_getsetlist [] = {
15411551 {"co_lnotab" , (getter )code_getlnotab , NULL , NULL },
15421552 // The following old names are kept for backward compatibility.
15431553 {"co_nlocals" , (getter )code_getnlocals , NULL , NULL },
15441554 {"co_varnames" , (getter )code_getvarnames , NULL , NULL },
15451555 {"co_cellvars" , (getter )code_getcellvars , NULL , NULL },
15461556 {"co_freevars" , (getter )code_getfreevars , NULL , NULL },
1557+ {"_co_quickened" , (getter )code_getquickened , NULL , NULL },
15471558 {0 }
15481559};
15491560
@@ -1902,7 +1913,7 @@ _PyCode_ConstantKey(PyObject *op)
19021913 return key ;
19031914}
19041915
1905- void
1916+ void
19061917_PyStaticCode_Dealloc (PyCodeObject * co )
19071918{
19081919 if (co -> co_quickened ) {
@@ -1921,7 +1932,7 @@ _PyStaticCode_Dealloc(PyCodeObject *co)
19211932}
19221933
19231934void
1924- _PyStaticCode_InternStrings (PyCodeObject * co )
1935+ _PyStaticCode_InternStrings (PyCodeObject * co )
19251936{
19261937 int res = intern_strings (co -> co_names );
19271938 assert (res == 0 );
0 commit comments