mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Raise ELSLInvalidType on invalid type passed to cond().
This commit is contained in:
parent
a5ec12c9e9
commit
0dc8629007
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue