Skip to content

Commit 606ab86

Browse files
Change order of io.UnsupportedOperation base classes.
This makes tests passing after changes by issue #5322.
1 parent 5adfac2 commit 606ab86

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/_pyio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def __new__(cls, *args, **kwargs):
276276
try:
277277
UnsupportedOperation = io.UnsupportedOperation
278278
except AttributeError:
279-
class UnsupportedOperation(ValueError, OSError):
279+
class UnsupportedOperation(OSError, ValueError):
280280
pass
281281

282282

Modules/_io/_iomodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ PyInit__io(void)
654654
/* UnsupportedOperation inherits from ValueError and IOError */
655655
state->unsupported_operation = PyObject_CallFunction(
656656
(PyObject *)&PyType_Type, "s(OO){}",
657-
"UnsupportedOperation", PyExc_ValueError, PyExc_IOError);
657+
"UnsupportedOperation", PyExc_OSError, PyExc_ValueError);
658658
if (state->unsupported_operation == NULL)
659659
goto fail;
660660
Py_INCREF(state->unsupported_operation);

0 commit comments

Comments
 (0)