seeking to an invalid position is an IOError in python 3.2

python >= 3.3 raises OSError in this case.
This commit is contained in:
Thomas Waldmann 2016-02-01 16:10:42 +01:00
parent 12c7ef1329
commit 7e5d30f41a
1 changed files with 1 additions and 1 deletions

View File

@ -529,7 +529,7 @@ class LoggedIO:
with open(filename, 'rb') as fd:
try:
fd.seek(-self.header_fmt.size, os.SEEK_END)
except OSError as e:
except (IOError, OSError) as e:
# return False if segment file is empty or too small
if e.errno == errno.EINVAL:
return False