11/*
22 An implementation of the new I/O lib as defined by PEP 3116 - "New I/O"
3-
3+
44 Classes defined here: UnsupportedOperation, BlockingIOError.
55 Functions defined here: open().
6-
6+
77 Mostly written by Amaury Forgeot d'Arc
88*/
99
@@ -510,7 +510,7 @@ PyNumber_AsOff_t(PyObject *item, PyObject *err)
510510
511511
512512/* Basically the "n" format code with the ability to turn None into -1. */
513- int
513+ int
514514_PyIO_ConvertSsize_t (PyObject * obj , void * result ) {
515515 Py_ssize_t limit ;
516516 if (obj == Py_None ) {
@@ -537,7 +537,6 @@ iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
537537 _PyIO_State * state = IO_MOD_STATE (mod );
538538 if (!state -> initialized )
539539 return 0 ;
540- Py_VISIT (state -> os_module );
541540 if (state -> locale_module != NULL ) {
542541 Py_VISIT (state -> locale_module );
543542 }
@@ -551,7 +550,6 @@ iomodule_clear(PyObject *mod) {
551550 _PyIO_State * state = IO_MOD_STATE (mod );
552551 if (!state -> initialized )
553552 return 0 ;
554- Py_CLEAR (state -> os_module );
555553 if (state -> locale_module != NULL )
556554 Py_CLEAR (state -> locale_module );
557555 Py_CLEAR (state -> unsupported_operation );
@@ -595,11 +593,6 @@ PyInit__io(void)
595593 state = IO_MOD_STATE (m );
596594 state -> initialized = 0 ;
597595
598- /* put os in the module state */
599- state -> os_module = PyImport_ImportModule ("os" );
600- if (state -> os_module == NULL )
601- goto fail ;
602-
603596#define ADD_TYPE (type , name ) \
604597 if (PyType_Ready(type) < 0) \
605598 goto fail; \
@@ -725,7 +718,6 @@ PyInit__io(void)
725718 return m ;
726719
727720 fail :
728- Py_XDECREF (state -> os_module );
729721 Py_XDECREF (state -> unsupported_operation );
730722 Py_DECREF (m );
731723 return NULL ;
0 commit comments