Skip to content

Commit 334f843

Browse files
authored
Update _pyio.py
1 parent 2531ccf commit 334f843

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/_pyio.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,8 +2458,6 @@ def detach(self):
24582458
return buffer
24592459

24602460
def seek(self, cookie, whence=0):
2461-
self._checkClosed()
2462-
24632461
def _reset_encoder(position):
24642462
"""Reset the encoder (merely useful for proper BOM handling)"""
24652463
try:
@@ -2473,6 +2471,7 @@ def _reset_encoder(position):
24732471
else:
24742472
encoder.reset()
24752473

2474+
self._checkClosed()
24762475
if not self._seekable:
24772476
raise UnsupportedOperation("underlying stream is not seekable")
24782477
if whence == SEEK_CUR:

0 commit comments

Comments
 (0)