Raise ELSLInvalidType on invalid type passed to cond().

This commit is contained in:
Sei Lisa 2017-10-14 14:17:42 +02:00
parent a5ec12c9e9
commit 0dc8629007

View file

@ -826,6 +826,8 @@ def less(a, b):
def cond(x): def cond(x):
"""Test whether x evaluates to True in a condition (if, while, for, ...)""" """Test whether x evaluates to True in a condition (if, while, for, ...)"""
tx = type(x) tx = type(x)
if tx not in Types:
raise ELSLInvalidType
if tx == Key: if tx == Key:
if x == NULL_KEY or len(x) != 36: if x == NULL_KEY or len(x) != 36:
return False return False