summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-09-29 07:27:15 (GMT)
committerGeorg Brandl <georg@python.org>2012-09-29 07:27:15 (GMT)
commit99a247fd01c1cd780c0c3ee1116657627f1ee744 (patch)
tree319e33cb6612c3fafb2eb82e15c5e85e3d771e4f /Lib/_pyio.py
parent1628eaa5dc8892ff381ca7558cc7c8d80fac494d (diff)
parent8ed677db129171317b8ee7cd45b39b9013f5a2d6 (diff)
downloadcpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.zip
cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.gz
cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.bz2
Merge with main repo default branch.
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index 387c585..fa77ec1 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -895,12 +895,18 @@ class BytesIO(BufferedIOBase):
return pos
def readable(self):
+ if self.closed:
+ raise ValueError("I/O operation on closed file.")
return True
def writable(self):
+ if self.closed:
+ raise ValueError("I/O operation on closed file.")
return True
def seekable(self):
+ if self.closed:
+ raise ValueError("I/O operation on closed file.")
return True
@@ -1562,6 +1568,8 @@ class TextIOWrapper(TextIOBase):
return self._buffer
def seekable(self):
+ if self.closed:
+ raise ValueError("I/O operation on closed file.")
return self._seekable
def readable(self):