diff --git a/third-party/thrift/src/thrift/lib/python/types.cpp b/third-party/thrift/src/thrift/lib/python/types.cpp index e56477a06f8b0a..8c18b8e2ba4fca 100644 --- a/third-party/thrift/src/thrift/lib/python/types.cpp +++ b/third-party/thrift/src/thrift/lib/python/types.cpp @@ -1705,11 +1705,15 @@ PyObject* getStandardMutableDefaultValuePtrForType( void tag_object_as_sequence(PyTypeObject* type_object) { DCHECK(PyType_Check(type_object)); +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 10 type_object->tp_flags |= Py_TPFLAGS_SEQUENCE; +#endif } void tag_object_as_mapping(PyTypeObject* type_object) { DCHECK(PyType_Check(type_object)); +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 10 type_object->tp_flags |= Py_TPFLAGS_MAPPING; +#endif } } // namespace apache::thrift::python