Commit 8568de9e authored by Michael Hanselmann's avatar Michael Hanselmann

ht.TInt: Exclude boolean values

See inline comment.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 72729d6e
......@@ -74,7 +74,12 @@ def TInt(val):
"""Checks if the given value is an integer.
"""
return isinstance(val, int)
# For backwards compatibility with older Python versions, boolean values are
# also integers and should be excluded in this test.
#
# >>> (isinstance(False, int), isinstance(True, int))
# (True, True)
return isinstance(val, int) and not isinstance(val, bool)
def TFloat(val):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment