From: Serhiy Storchaka Date: Wed, 7 Dec 2016 11:31:20 +0000 (+0200) Subject: Change order of io.UnsupportedOperation base classes. X-Git-Tag: v3.5.3rc1~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=606ab86c0e11eb00fc276c694bff9d7f9239d538;p=python Change order of io.UnsupportedOperation base classes. This makes tests passing after changes by issue #5322. --- diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 0d98b74476..f2fe447143 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -276,7 +276,7 @@ class OpenWrapper: try: UnsupportedOperation = io.UnsupportedOperation except AttributeError: - class UnsupportedOperation(ValueError, OSError): + class UnsupportedOperation(OSError, ValueError): pass diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 65c955ac69..e9f22afb50 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -654,7 +654,7 @@ PyInit__io(void) /* UnsupportedOperation inherits from ValueError and IOError */ state->unsupported_operation = PyObject_CallFunction( (PyObject *)&PyType_Type, "s(OO){}", - "UnsupportedOperation", PyExc_ValueError, PyExc_IOError); + "UnsupportedOperation", PyExc_OSError, PyExc_ValueError); if (state->unsupported_operation == NULL) goto fail; Py_INCREF(state->unsupported_operation);