Skip to content

Commit

Permalink
Fix Cinder's awaiter flag to not conflict with version tag
Browse files Browse the repository at this point in the history
Summary:
`Py_TPFLAGS_HAVE_VERSION_TAG   (1UL << 18)` is defined on line 575 as `(1UL << 18)` so we can't use 18 here. Change to 21 which is unused.

This is causing a crash when subclassing a Cython class D60555759 and trying to copy the non-existent async methods here: https://www.internalfb.com/code/fbsource/[03a8cbcbe4d4f8d35cf0837de169925d564d479f]/third-party/python/3.12/Objects/typeobject.c?lines=3352

Reviewed By: yulong-zhang-1

Differential Revision: D60627205

fbshipit-source-id: d3d5998b39df88d9aa03c04539f7adfdf52f0121
  • Loading branch information
DinoV authored and facebook-github-bot committed Aug 2, 2024
1 parent f001f97 commit c175b46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,15 +527,15 @@ given type object has a specified feature.
/* Objects behave like an unbound method */
#define Py_TPFLAGS_METHOD_DESCRIPTOR (1UL << 17)

/* Set if type's tp_as_async slot points to Ci_AsyncMethodsWithExtra */
#define Ci_TPFLAGS_HAVE_AM_EXTRA (1UL << 18)

/* Object has up-to-date type attribute cache */
#define Py_TPFLAGS_VALID_VERSION_TAG (1UL << 19)

/* Type is abstract and cannot be instantiated */
#define Py_TPFLAGS_IS_ABSTRACT (1UL << 20)

/* Set if type's tp_as_async slot points to Ci_AsyncMethodsWithExtra */
#define Ci_TPFLAGS_HAVE_AM_EXTRA (1UL << 21)

// This undocumented flag gives certain built-ins their unique pattern-matching
// behavior, which allows a single positional subpattern to match against the
// subject itself (rather than a mapped attribute on it):
Expand Down

0 comments on commit c175b46

Please sign in to comment.