From fc531fe0d251a9d4cd3f5cc3d9c961d261824bb1 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 12 Sep 2011 10:02:14 +0200 Subject: [PATCH] Better error handling Version:1.2.2 --- src/variable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/variable.py b/src/variable.py index b1d02b5..89bd434 100644 --- a/src/variable.py +++ b/src/variable.py @@ -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