Skip to content

Commit 564279c

Browse files
committed
Silence deprecation warning when testing element's truth value
This fixes the following deprecation warning, new as of Python 3.12: DeprecationWarning: Testing an element's truth value will always return True in future versions. We do want the future behavior here, but since we can't opt into it cleanly just test vs None explicitly.
1 parent 23d3ab9 commit 564279c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

generate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def is_descendant_type(types, name, base):
5252
if name == base:
5353
return True
5454
type = types.get(name)
55-
if not type:
55+
if type is None:
5656
return False
5757
parents = type.get('parent')
5858
if not parents:

0 commit comments

Comments
 (0)