@@ -583,13 +583,18 @@ iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
583
583
Py_VISIT (state -> locale_module );
584
584
Py_VISIT (state -> unsupported_operation );
585
585
586
+ Py_VISIT (state -> PyIncrementalNewlineDecoder_Type );
587
+ Py_VISIT (state -> PyRawIOBase_Type );
588
+ Py_VISIT (state -> PyBufferedIOBase_Type );
586
589
Py_VISIT (state -> PyBufferedRWPair_Type );
587
590
Py_VISIT (state -> PyBufferedRandom_Type );
588
591
Py_VISIT (state -> PyBufferedReader_Type );
589
592
Py_VISIT (state -> PyBufferedWriter_Type );
593
+ Py_VISIT (state -> PyBytesIOBuffer_Type );
590
594
Py_VISIT (state -> PyBytesIO_Type );
591
595
Py_VISIT (state -> PyFileIO_Type );
592
596
Py_VISIT (state -> PyStringIO_Type );
597
+ Py_VISIT (state -> PyTextIOBase_Type );
593
598
Py_VISIT (state -> PyTextIOWrapper_Type );
594
599
return 0 ;
595
600
}
@@ -604,13 +609,18 @@ iomodule_clear(PyObject *mod) {
604
609
Py_CLEAR (state -> locale_module );
605
610
Py_CLEAR (state -> unsupported_operation );
606
611
612
+ Py_CLEAR (state -> PyIncrementalNewlineDecoder_Type );
613
+ Py_CLEAR (state -> PyRawIOBase_Type );
614
+ Py_CLEAR (state -> PyBufferedIOBase_Type );
607
615
Py_CLEAR (state -> PyBufferedRWPair_Type );
608
616
Py_CLEAR (state -> PyBufferedRandom_Type );
609
617
Py_CLEAR (state -> PyBufferedReader_Type );
610
618
Py_CLEAR (state -> PyBufferedWriter_Type );
619
+ Py_CLEAR (state -> PyBytesIOBuffer_Type );
611
620
Py_CLEAR (state -> PyBytesIO_Type );
612
621
Py_CLEAR (state -> PyFileIO_Type );
613
622
Py_CLEAR (state -> PyStringIO_Type );
623
+ Py_CLEAR (state -> PyTextIOBase_Type );
614
624
Py_CLEAR (state -> PyTextIOWrapper_Type );
615
625
return 0 ;
616
626
}
@@ -749,24 +759,33 @@ PyInit__io(void)
749
759
}
750
760
}
751
761
762
+ // Base classes
763
+ state -> PyIncrementalNewlineDecoder_Type = (PyTypeObject * )Py_NewRef (& PyIncrementalNewlineDecoder_Type );
764
+
765
+ // PyIOBase_Type subclasses
766
+ state -> PyRawIOBase_Type = (PyTypeObject * )Py_NewRef (& PyRawIOBase_Type );
767
+ state -> PyBufferedIOBase_Type = (PyTypeObject * )Py_NewRef (& PyBufferedIOBase_Type );
768
+ state -> PyTextIOBase_Type = (PyTypeObject * )Py_NewRef (& PyTextIOBase_Type );
769
+
752
770
// PyBufferedIOBase_Type(PyIOBase_Type) subclasses
753
- ADD_TYPE (m , state -> PyBytesIO_Type , & bytesio_spec , & PyBufferedIOBase_Type );
771
+ ADD_TYPE (m , state -> PyBytesIO_Type , & bytesio_spec , state -> PyBufferedIOBase_Type );
754
772
ADD_TYPE (m , state -> PyBufferedWriter_Type , & bufferedwriter_spec ,
755
- & PyBufferedIOBase_Type );
773
+ state -> PyBufferedIOBase_Type );
756
774
ADD_TYPE (m , state -> PyBufferedReader_Type , & bufferedreader_spec ,
757
- & PyBufferedIOBase_Type );
775
+ state -> PyBufferedIOBase_Type );
758
776
ADD_TYPE (m , state -> PyBufferedRWPair_Type , & bufferedrwpair_spec ,
759
- & PyBufferedIOBase_Type );
777
+ state -> PyBufferedIOBase_Type );
760
778
ADD_TYPE (m , state -> PyBufferedRandom_Type , & bufferedrandom_spec ,
761
- & PyBufferedIOBase_Type );
779
+ state -> PyBufferedIOBase_Type );
762
780
763
781
// PyRawIOBase_Type(PyIOBase_Type) subclasses
764
- ADD_TYPE (m , state -> PyFileIO_Type , & fileio_spec , & PyRawIOBase_Type );
782
+ state -> PyBytesIOBuffer_Type = (PyTypeObject * )Py_NewRef (& _PyBytesIOBuffer_Type );
783
+ ADD_TYPE (m , state -> PyFileIO_Type , & fileio_spec , state -> PyRawIOBase_Type );
765
784
766
785
// PyTextIOBase_Type(PyIOBase_Type) subclasses
767
- ADD_TYPE (m , state -> PyStringIO_Type , & stringio_spec , & PyTextIOBase_Type );
786
+ ADD_TYPE (m , state -> PyStringIO_Type , & stringio_spec , state -> PyTextIOBase_Type );
768
787
ADD_TYPE (m , state -> PyTextIOWrapper_Type , & textiowrapper_spec ,
769
- & PyTextIOBase_Type );
788
+ state -> PyTextIOBase_Type );
770
789
771
790
state -> initialized = 1 ;
772
791
0 commit comments