1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 05:08:42 +02: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
if pkg[-4:] != '.rpm':
return
fd = os.open(pkg, os.O_RDONLY)
hdr = self.ts.hdrFromFdno(fd)
os.close(fd)
fd = None
try:
fd = os.open(pkg, os.O_RDONLY)
hdr = self.ts.hdrFromFdno(fd)
finally:
if fd is not None:
os.close(fd)
if __name__ == "__main__":
import sys