[Python-checkins] cpython (3.5): Change order of io.UnsupportedOperation base classes.

serhiy.storchaka python-checkins at python.org
Wed Dec 7 06:32:24 EST 2016


https://hg.python.org/cpython/rev/4a610bc8577b
changeset:   105510:4a610bc8577b
branch:      3.5
parent:      105505:1f31bf3f76f5
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Dec 07 13:31:20 2016 +0200
summary:
  Change order of io.UnsupportedOperation base classes.
This makes tests passing after changes by issue #5322.

files:
  Lib/_pyio.py            |  2 +-
  Modules/_io/_iomodule.c |  2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/_pyio.py b/Lib/_pyio.py
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -276,7 +276,7 @@
 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
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -654,7 +654,7 @@
     /* 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);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list