소스 검색

seeking to an invalid position is an IOError in python 3.2

python >= 3.3 raises OSError in this case.
Thomas Waldmann 9 년 전
부모
커밋
7e5d30f41a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      borg/repository.py

+ 1 - 1
borg/repository.py

@@ -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