bcanvas/CanvasImportStore.py:importTextBuffer(): handle exceptions.

This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-14 11:52:24 +02:00
parent f6afcd735a
commit 1d927bf2b9

View File

@ -93,6 +93,7 @@ class CanvasImportStore():
# }}} # }}}
# {{{ importTextBuffer(self, inFile) # {{{ importTextBuffer(self, inFile)
def importTextBuffer(self, inFile): def importTextBuffer(self, inFile):
try:
inLine, outMap, outMaxCols = inFile.readline(), [], 0 inLine, outMap, outMaxCols = inFile.readline(), [], 0
while inLine: while inLine:
inCellState, inCurCol, inCurColours, inMaxCol = self._CellState.CS_NONE, 0, (15, -1), len(inLine); outMap.append([]); inCellState, inCurCol, inCurColours, inMaxCol = self._CellState.CS_NONE, 0, (15, -1), len(inLine); outMap.append([]);
@ -134,6 +135,8 @@ class CanvasImportStore():
return (True, None) return (True, None)
else: else:
return (False, "empty output map") return (False, "empty output map")
except:
return (False, sys.exc_info()[1])
# }}} # }}}
# {{{ importTextFile(self, pathName) # {{{ importTextFile(self, pathName)
def importTextFile(self, pathName): def importTextFile(self, pathName):