mirror of https://github.com/python/cpython
Hopeful fix for issue 1878: remove Py_TPFLAGS_HAVE_VERSION_TAG from
Py_TPFLAGS_DEFAULT when not building the core.
This commit is contained in:
parent
80f0ed5bb1
commit
69ed1011aa
|
@ -530,6 +530,12 @@ Type definitions should use Py_TPFLAGS_DEFAULT for their tp_flags value.
|
|||
|
||||
Code can use PyType_HasFeature(type_ob, flag_value) to test whether the
|
||||
given type object has a specified feature.
|
||||
|
||||
NOTE: when building the core, Py_TPFLAGS_DEFAULT includes
|
||||
Py_TPFLAGS_HAVE_VERSION_TAG; outside the core, it doesn't. This is so
|
||||
that extensions that modify tp_dict of their own types directly don't
|
||||
break, since this was allowed in 2.5. In 3.0 they will have to
|
||||
manually remove this flag though!
|
||||
*/
|
||||
|
||||
/* PyBufferProcs contains bf_getcharbuffer */
|
||||
|
@ -606,7 +612,7 @@ given type object has a specified feature.
|
|||
#define Py_TPFLAGS_BASE_EXC_SUBCLASS (1L<<30)
|
||||
#define Py_TPFLAGS_TYPE_SUBCLASS (1L<<31)
|
||||
|
||||
#define Py_TPFLAGS_DEFAULT ( \
|
||||
#define Py_TPFLAGS_DEFAULT_EXTERNAL ( \
|
||||
Py_TPFLAGS_HAVE_GETCHARBUFFER | \
|
||||
Py_TPFLAGS_HAVE_SEQUENCE_IN | \
|
||||
Py_TPFLAGS_HAVE_INPLACEOPS | \
|
||||
|
@ -616,8 +622,15 @@ given type object has a specified feature.
|
|||
Py_TPFLAGS_HAVE_CLASS | \
|
||||
Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \
|
||||
Py_TPFLAGS_HAVE_INDEX | \
|
||||
Py_TPFLAGS_HAVE_VERSION_TAG | \
|
||||
0)
|
||||
#define Py_TPFLAGS_DEFAULT_CORE (Py_TPFLAGS_DEFAULT_EXTERNAL | \
|
||||
Py_TPFLAGS_HAVE_VERSION_TAG)
|
||||
|
||||
#ifdef Py_BUILD_CORE
|
||||
#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_CORE
|
||||
#else
|
||||
#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_EXTERNAL
|
||||
#endif
|
||||
|
||||
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
|
||||
#define PyType_FastSubclass(t,f) PyType_HasFeature(t,f)
|
||||
|
|
Loading…
Reference in New Issue