From 823e13fb755756117d44f8e92d09206495b2410c Mon Sep 17 00:00:00 2001 From: David Vierra Date: Wed, 22 Sep 2010 12:10:09 -1000 Subject: [PATCH] raise IOError when this weird condition happens - created a chunk without checking for its file --- mclevel.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mclevel.py b/mclevel.py index b67a835..b28d4c5 100644 --- a/mclevel.py +++ b/mclevel.py @@ -1291,10 +1291,13 @@ class InfdevChunk(MCLevel): def load(self): if self.compressedTag is None: - compressedData = file(self.filename, 'rb') - self.compressedTag = compressedData.read(); - compressedData.close() - + try: + compressedData = file(self.filename, 'rb') + self.compressedTag = compressedData.read(); + compressedData.close() + except IOError: + raise ChunkNotPresent + if self.root_tag is None: self.decompress()