From 74f406b505a762c8e55b210539a13ed66b0ae50a Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 31 Mar 2011 13:06:17 +0000 Subject: catch IndexError exception that was causing run_blocks to fail --- diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 59eb3c8..4662429 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -180,7 +180,11 @@ class LogoCode: if b.connections is not None and len(b.connections) > 1 and \ b.connections[1] is not None: code = self._blocks_to_code(b) - x = b.connections[1].values[0] + try: + x = b.connections[1].values[0] + except IndexError: + self.tw.showlabel('#nostack') + return None if type(convert(x, float, False)) == float: if int(float(x)) == x: x = int(x) -- cgit v0.9.1