From 0dc862900719b9c85bf34a6d3f6f78de6b007887 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 14 Oct 2017 14:17:42 +0200 Subject: [PATCH] Raise ELSLInvalidType on invalid type passed to cond(). --- lslopt/lslbasefuncs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lslopt/lslbasefuncs.py b/lslopt/lslbasefuncs.py index 6f86f6f..92d1158 100644 --- a/lslopt/lslbasefuncs.py +++ b/lslopt/lslbasefuncs.py @@ -826,6 +826,8 @@ def less(a, b): def cond(x): """Test whether x evaluates to True in a condition (if, while, for, ...)""" tx = type(x) + if tx not in Types: + raise ELSLInvalidType if tx == Key: if x == NULL_KEY or len(x) != 36: return False