Better error handling

Version:1.2.2
This commit is contained in:
Anthony Scemama 2011-09-12 10:02:14 +02:00
parent b43edb99c5
commit fc531fe0d2
1 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,10 @@ class Variable(object):
if '_type' not in self.__dict__:
line = self.line.text
buffer = line.split(',')[0]
buffer = buffer.split('[')[1].strip()
try:
buffer = buffer.split('[')[1].strip()
except IndexError:
error.fail(None,"Error in definition of %s."%(self.name))
if self.dim != []:
buffer = "%s, allocatable"%(buffer)
self._type = buffer