From c57be77bcc581e53ae5be31e3ca9dbe0b0087ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Pluta?= Date: Tue, 9 Jul 2019 23:27:53 +0200 Subject: [PATCH] Fix checking attempts to access items outside the list --- smnp/module/iterable/function/get.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smnp/module/iterable/function/get.py b/smnp/module/iterable/function/get.py index c2cbba8..4086887 100644 --- a/smnp/module/iterable/function/get.py +++ b/smnp/module/iterable/function/get.py @@ -8,7 +8,7 @@ _signature1 = signature(ofType(Type.LIST), ofType(Type.INTEGER)) def _function1(env, list, index): try: return list.value[index.value] - except KeyError: + except IndexError: raise RuntimeException(f"Attempt to access item which is outside the list", None)