From 7a54c3a110da4042d776f2b0f251f6900895521e Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Mon, 29 Mar 2021 09:52:38 +0200 Subject: [PATCH] rclpython.py: dont try to subscript an exception --- src/filters/rclpython.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/filters/rclpython.py b/src/filters/rclpython.py index 15e58fb8..ea1edea8 100755 --- a/src/filters/rclpython.py +++ b/src/filters/rclpython.py @@ -137,14 +137,6 @@ class Parser: try: for a,b,c,d,e in tokenize.tokenize(text.readline): self(a,b,c,d,e) - except tokenize.TokenError as ex: - msg = ex[0] - line = ex[1][0] - self.out.write(("

ERROR: %s

%s\n" % ( - msg, self.raw[self.lines[line]:])).encode('utf-8')) - except IndentationError as ex: - msg = ex[0] - self.out.write(("

ERROR: %s

\n" % (msg)).encode('utf-8')) except Exception as ex: # There are other possible exceptions, for example for a # bad encoding line (->SyntaxError). e.g. # -*- coding: lala -*-