@@ -261,6 +261,9 @@ public static int magic() {
261
261
#if ( PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 )
262
262
/* Type attribute cache version tag. Added in version 2.6 */
263
263
public static int tp_version_tag ;
264
+ #endif
265
+ #if ( PYTHON34 )
266
+ public static int tp_finalize = 0 ;
264
267
#endif
265
268
// COUNT_ALLOCS adds some more stuff to PyTypeObject
266
269
#if ( Py_COUNT_ALLOCS )
@@ -470,6 +473,8 @@ public static void FreeModuleDef(IntPtr ptr) {
470
473
/// to good use as PythonNet specific flags (Managed and Subclass)
471
474
/// </summary>
472
475
internal class TypeFlags {
476
+ #if ( PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27 )
477
+ // these flags were removed in Python 3
473
478
public static int HaveGetCharBuffer = ( 1 << 0 ) ;
474
479
public static int HaveSequenceIn = ( 1 << 1 ) ;
475
480
public static int GC = 0 ;
@@ -479,6 +484,7 @@ internal class TypeFlags {
479
484
public static int HaveWeakRefs = ( 1 << 6 ) ;
480
485
public static int HaveIter = ( 1 << 7 ) ;
481
486
public static int HaveClass = ( 1 << 8 ) ;
487
+ #endif
482
488
public static int HeapType = ( 1 << 9 ) ;
483
489
public static int BaseType = ( 1 << 10 ) ;
484
490
public static int Ready = ( 1 << 12 ) ;
@@ -509,18 +515,31 @@ internal class TypeFlags {
509
515
public static int BaseExceptionSubclass = ( 1 << 30 ) ;
510
516
public static int TypeSubclass = ( 1 << 31 ) ;
511
517
#endif
512
- public static int Default = ( HaveGetCharBuffer |
518
+
519
+ // Default flags for Python 2
520
+ #if ( PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27 )
521
+ public static int Default = (
522
+ HaveGetCharBuffer |
513
523
HaveSequenceIn |
514
524
HaveInPlaceOps |
515
525
HaveRichCompare |
516
526
HaveWeakRefs |
517
527
HaveIter |
518
528
HaveClass |
519
529
HaveStacklessExtension |
520
- #if ( PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 )
530
+ #if ( PYTHON25 || PYTHON26 || PYTHON27 )
521
531
HaveIndex |
522
- #endif
532
+ #endif
523
533
0 ) ;
534
+ #endif
535
+
536
+ // Default flags for Python 3
537
+ #if ( PYTHON32 || PYTHON33 || PYTHON34 )
538
+ public static int Default = (
539
+ HaveStacklessExtension |
540
+ HaveVersionTag ) ;
541
+ #endif
542
+
524
543
}
525
544
526
545
0 commit comments