mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-05 02:56:17 +01:00
- checker.check: always close fd
This commit is contained in:
parent
1d7cb3d1db
commit
87aaa9aac4
@ -92,8 +92,12 @@ class Checker:
|
|||||||
# avoid errors on non rpm
|
# avoid errors on non rpm
|
||||||
if pkg[-4:] != '.rpm':
|
if pkg[-4:] != '.rpm':
|
||||||
return
|
return
|
||||||
|
fd = None
|
||||||
|
try:
|
||||||
fd = os.open(pkg, os.O_RDONLY)
|
fd = os.open(pkg, os.O_RDONLY)
|
||||||
hdr = self.ts.hdrFromFdno(fd)
|
hdr = self.ts.hdrFromFdno(fd)
|
||||||
|
finally:
|
||||||
|
if fd is not None:
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user