Correct references to ChunkMalformed exception in dumpSigns/dumpChests

The exception handlers in the dumpSigns and dumpChests commands
referenced ChunkMalformed in the wrong package.

This fix corrects the references, but note that this by itself is not
desirable, as ChunkMalformed is raised when a MemoryError occurs, and
the exception handlers ignore the exception.  As a MemoryError is not
likely to go away by itself, this can result in a flood of error
messages being printed, instead of the existing behaviour where
execution of the command terminates due to the incorrect reference to
ChunkMalformed.
This commit is contained in:
David O'Shea 2012-09-29 23:24:56 +09:30
parent 0e4399b053
commit 96c155909e

5
mce.py
View File

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
import mclevelbase
import mclevel import mclevel
import infiniteworld import infiniteworld
import sys import sys
@ -620,7 +621,7 @@ class mce(object):
for i, cPos in enumerate(self.level.allChunks): for i, cPos in enumerate(self.level.allChunks):
try: try:
chunk = self.level.getChunk(*cPos) chunk = self.level.getChunk(*cPos)
except mclevel.ChunkMalformed: except mclevelbase.ChunkMalformed:
continue continue
for tileEntity in chunk.TileEntities: for tileEntity in chunk.TileEntities:
@ -779,7 +780,7 @@ class mce(object):
for i, cPos in enumerate(self.level.allChunks): for i, cPos in enumerate(self.level.allChunks):
try: try:
chunk = self.level.getChunk(*cPos) chunk = self.level.getChunk(*cPos)
except mclevel.ChunkMalformed: except mclevelbase.ChunkMalformed:
continue continue
for tileEntity in chunk.TileEntities: for tileEntity in chunk.TileEntities: