mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 06:46:13 +01:00
- checker.check: always close fd
This commit is contained in:
parent
1d7cb3d1db
commit
87aaa9aac4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user