@@ -128,7 +128,7 @@ static PyObject *CF_Error;
128128
129129PyTypeObject CFTypeRef_Type ;
130130
131- #define CFTypeRefObj_Check (x ) ((x)->ob_type == &CFTypeRef_Type)
131+ #define CFTypeRefObj_Check (x ) ((x)->ob_type == &CFTypeRef_Type || PyObject_TypeCheck((x), &CFTypeRef_Type) )
132132
133133typedef struct CFTypeRefObject {
134134 PyObject_HEAD
@@ -442,7 +442,7 @@ PyTypeObject CFTypeRef_Type = {
442442
443443PyTypeObject CFArrayRef_Type ;
444444
445- #define CFArrayRefObj_Check (x ) ((x)->ob_type == &CFArrayRef_Type)
445+ #define CFArrayRefObj_Check (x ) ((x)->ob_type == &CFArrayRef_Type || PyObject_TypeCheck((x), &CFArrayRef_Type) )
446446
447447typedef struct CFArrayRefObject {
448448 PyObject_HEAD
@@ -598,7 +598,7 @@ PyTypeObject CFArrayRef_Type = {
598598
599599PyTypeObject CFMutableArrayRef_Type ;
600600
601- #define CFMutableArrayRefObj_Check (x ) ((x)->ob_type == &CFMutableArrayRef_Type)
601+ #define CFMutableArrayRefObj_Check (x ) ((x)->ob_type == &CFMutableArrayRef_Type || PyObject_TypeCheck((x), &CFMutableArrayRef_Type) )
602602
603603typedef struct CFMutableArrayRefObject {
604604 PyObject_HEAD
@@ -783,7 +783,7 @@ PyTypeObject CFMutableArrayRef_Type = {
783783
784784PyTypeObject CFDictionaryRef_Type ;
785785
786- #define CFDictionaryRefObj_Check (x ) ((x)->ob_type == &CFDictionaryRef_Type)
786+ #define CFDictionaryRefObj_Check (x ) ((x)->ob_type == &CFDictionaryRef_Type || PyObject_TypeCheck((x), &CFDictionaryRef_Type) )
787787
788788typedef struct CFDictionaryRefObject {
789789 PyObject_HEAD
@@ -921,7 +921,7 @@ PyTypeObject CFDictionaryRef_Type = {
921921
922922PyTypeObject CFMutableDictionaryRef_Type ;
923923
924- #define CFMutableDictionaryRefObj_Check (x ) ((x)->ob_type == &CFMutableDictionaryRef_Type)
924+ #define CFMutableDictionaryRefObj_Check (x ) ((x)->ob_type == &CFMutableDictionaryRef_Type || PyObject_TypeCheck((x), &CFMutableDictionaryRef_Type) )
925925
926926typedef struct CFMutableDictionaryRefObject {
927927 PyObject_HEAD
@@ -1043,7 +1043,7 @@ PyTypeObject CFMutableDictionaryRef_Type = {
10431043
10441044PyTypeObject CFDataRef_Type ;
10451045
1046- #define CFDataRefObj_Check (x ) ((x)->ob_type == &CFDataRef_Type)
1046+ #define CFDataRefObj_Check (x ) ((x)->ob_type == &CFDataRef_Type || PyObject_TypeCheck((x), &CFDataRef_Type) )
10471047
10481048typedef struct CFDataRefObject {
10491049 PyObject_HEAD
@@ -1219,7 +1219,7 @@ PyTypeObject CFDataRef_Type = {
12191219
12201220PyTypeObject CFMutableDataRef_Type ;
12211221
1222- #define CFMutableDataRefObj_Check (x ) ((x)->ob_type == &CFMutableDataRef_Type)
1222+ #define CFMutableDataRefObj_Check (x ) ((x)->ob_type == &CFMutableDataRef_Type || PyObject_TypeCheck((x), &CFMutableDataRef_Type) )
12231223
12241224typedef struct CFMutableDataRefObject {
12251225 PyObject_HEAD
@@ -1429,7 +1429,7 @@ PyTypeObject CFMutableDataRef_Type = {
14291429
14301430PyTypeObject CFStringRef_Type ;
14311431
1432- #define CFStringRefObj_Check (x ) ((x)->ob_type == &CFStringRef_Type)
1432+ #define CFStringRefObj_Check (x ) ((x)->ob_type == &CFStringRef_Type || PyObject_TypeCheck((x), &CFStringRef_Type) )
14331433
14341434typedef struct CFStringRefObject {
14351435 PyObject_HEAD
@@ -2114,7 +2114,7 @@ PyTypeObject CFStringRef_Type = {
21142114
21152115PyTypeObject CFMutableStringRef_Type ;
21162116
2117- #define CFMutableStringRefObj_Check (x ) ((x)->ob_type == &CFMutableStringRef_Type)
2117+ #define CFMutableStringRefObj_Check (x ) ((x)->ob_type == &CFMutableStringRef_Type || PyObject_TypeCheck((x), &CFMutableStringRef_Type) )
21182118
21192119typedef struct CFMutableStringRefObject {
21202120 PyObject_HEAD
@@ -2447,7 +2447,7 @@ PyTypeObject CFMutableStringRef_Type = {
24472447
24482448PyTypeObject CFURLRef_Type ;
24492449
2450- #define CFURLRefObj_Check (x ) ((x)->ob_type == &CFURLRef_Type)
2450+ #define CFURLRefObj_Check (x ) ((x)->ob_type == &CFURLRef_Type || PyObject_TypeCheck((x), &CFURLRef_Type) )
24512451
24522452typedef struct CFURLRefObject {
24532453 PyObject_HEAD
0 commit comments