PyQIODevice: Raise ValueError when closed.

This commit is contained in:
Florian Bruhin 2015-05-25 20:42:45 +02:00
parent e10da78a1a
commit fa69786b0f

View File

@ -235,9 +235,9 @@ class PyQIODevice(io.BufferedIOBase):
return self._dev.size() return self._dev.size()
def _check_open(self): def _check_open(self):
"""Check if the device is open, raise OSError if not.""" """Check if the device is open, raise ValueError if not."""
if not self._dev.isOpen(): if not self._dev.isOpen():
raise OSError("IO operation on closed device!") raise ValueError("IO operation on closed device!")
def _check_random(self): def _check_random(self):
"""Check if the device supports random access, raise OSError if not.""" """Check if the device supports random access, raise OSError if not."""