Skip to content

Commit c538e9f

Browse files
Use the already defined TypeFlags.HaveIter instead of redefining it
1 parent 1d33284 commit c538e9f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/runtime/runtime.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,8 @@ internal static bool PyObject_IsIterable(IntPtr pointer)
785785
{
786786
var ob_type = Marshal.ReadIntPtr(pointer, ObjectOffset.ob_type);
787787
#if PYTHON2
788-
int Py_TPFLAGS_HAVE_ITER = 1 << 7;
789788
long tp_flags = Marshal.ReadInt64(ob_type, TypeOffset.tp_flags);
790-
if ((tp_flags & Py_TPFLAGS_HAVE_ITER) == 0)
789+
if ((tp_flags & TypeFlags.HaveIter) == 0)
791790
return false;
792791
#endif
793792
IntPtr tp_iter = Marshal.ReadIntPtr(ob_type, TypeOffset.tp_iter);
@@ -1443,9 +1442,8 @@ internal static bool PyIter_Check(IntPtr pointer)
14431442
{
14441443
var ob_type = Marshal.ReadIntPtr(pointer, ObjectOffset.ob_type);
14451444
#if PYTHON2
1446-
int Py_TPFLAGS_HAVE_ITER = 1 << 7;
14471445
long tp_flags = Marshal.ReadInt64(ob_type, TypeOffset.tp_flags);
1448-
if ((tp_flags & Py_TPFLAGS_HAVE_ITER) == 0)
1446+
if ((tp_flags & TypeFlags.HaveIter) == 0)
14491447
return false;
14501448
#endif
14511449
IntPtr tp_iternext = Marshal.ReadIntPtr(ob_type, TypeOffset.tp_iternext);

0 commit comments

Comments
 (0)