rmtew committed 304fcd3 Draft

Restore the flag clearing line I removed from Anselm's patch, and added comments.

Comments (0)

Files changed (1)


     if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_STACKLESS_EXTENSION)) {
+        /* Extension compiled against Stackless with our extended PyTypeObject. */
         memcpy(type, &_struct_sequence_template, sizeof(PyTypeObject));
     } else {
+        /* Extension compiled against vanilla Python with the unextended PyTypeObject. */
         memcpy(type, &_struct_sequence_template, VANILLA_PYTYPEOBJECT_SIZE);
+        /* The template data has put in place the Stackless flags, restore their absence. */
+        type->tp_flags &= ~Py_TPFLAGS_HAVE_STACKLESS_EXTENSION;
     memcpy(type, &_struct_sequence_template, sizeof(PyTypeObject));