Tweaked CBZ detection
This commit is contained in:
1 parent
1d4319be2e
commit
c6179b0064
1 file changed
+2
-3
+2
-3
@@ -360,9 +360,8 @@ class RarCannotExec(RarExecError):
|
|||||||
|
|
||||||
def is_rarfile(xfile):
|
def is_rarfile(xfile):
|
||||||
'''Check quickly whether file is rar archive.'''
|
'''Check quickly whether file is rar archive.'''
|
||||||
fd = XFile(xfile)
|
with open(xfile, 'rb') as fh:
|
||||||
buf = fd.read(len(RAR_ID))
|
buf = fh.read(len(RAR_ID))
|
||||||
fd.close()
|
|
||||||
if buf == RAR_ID or buf == RAR5_ID:
|
if buf == RAR_ID or buf == RAR5_ID:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in new issue
Block a user