Commits

rmtew  committed aff6741 Draft

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

  • Participants
  • Parent commits 70a46c5
  • Branches 2.7-slp

Comments (0)

Files changed (1)

File Objects/structseq.c

 
 #ifdef STACKLESS
     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;
     }
 #else
     memcpy(type, &_struct_sequence_template, sizeof(PyTypeObject));