1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-05 10:58:07 +01:00

- checker.check: always close fd

This commit is contained in:
Marcus Huewe 2013-07-04 14:24:29 +02:00
parent 1d7cb3d1db
commit 87aaa9aac4

View File

@ -92,9 +92,13 @@ class Checker:
# avoid errors on non rpm # avoid errors on non rpm
if pkg[-4:] != '.rpm': if pkg[-4:] != '.rpm':
return return
fd = os.open(pkg, os.O_RDONLY) fd = None
hdr = self.ts.hdrFromFdno(fd) try:
os.close(fd) fd = os.open(pkg, os.O_RDONLY)
hdr = self.ts.hdrFromFdno(fd)
finally:
if fd is not None:
os.close(fd)
if __name__ == "__main__": if __name__ == "__main__":
import sys import sys