mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 09:46:25 +00:00
Tweaked CBZ detection
This commit is contained in:
@@ -360,9 +360,8 @@ class RarCannotExec(RarExecError):
|
||||
|
||||
def is_rarfile(xfile):
|
||||
'''Check quickly whether file is rar archive.'''
|
||||
fd = XFile(xfile)
|
||||
buf = fd.read(len(RAR_ID))
|
||||
fd.close()
|
||||
with open(xfile, 'rb') as fh:
|
||||
buf = fh.read(len(RAR_ID))
|
||||
if buf == RAR_ID or buf == RAR5_ID:
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user