raise IOError when this weird condition happens - created a chunk without checking for its file
This commit is contained in:
parent
bcb8dde14b
commit
823e13fb75
11
mclevel.py
11
mclevel.py
@ -1291,10 +1291,13 @@ class InfdevChunk(MCLevel):
|
|||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
if self.compressedTag is None:
|
if self.compressedTag is None:
|
||||||
compressedData = file(self.filename, 'rb')
|
try:
|
||||||
self.compressedTag = compressedData.read();
|
compressedData = file(self.filename, 'rb')
|
||||||
compressedData.close()
|
self.compressedTag = compressedData.read();
|
||||||
|
compressedData.close()
|
||||||
|
except IOError:
|
||||||
|
raise ChunkNotPresent
|
||||||
|
|
||||||
if self.root_tag is None:
|
if self.root_tag is None:
|
||||||
self.decompress()
|
self.decompress()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user