Skip to content

Commit 41fed18

Browse files
committed
Small update
1 parent d4df97d commit 41fed18

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pycatfile/pycatfile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,8 +2150,11 @@ def CheckCompressionSubType(infile, formatspecs=__file_format_multi_dict__, file
21502150
if(prefp == binascii.unhexlify("7061785f676c6f62616c")):
21512151
filetype = "tarfile"
21522152
fp.seek(curloc, 0)
2153-
if(hasattr(precfp, "read")):
2154-
precfp.close()
2153+
try:
2154+
if(hasattr(precfp, "read")):
2155+
precfp.close()
2156+
except NameError:
2157+
pass
21552158
if(closefp):
21562159
fp.close()
21572160
return filetype

0 commit comments

Comments
 (0)