Browse Source

Fix syntax warning about assert

SyntaxWarning: assertion is always true, perhaps remove parentheses?

assert is a keyword, not a function, and using it with parentheses
ends up being interpreted as a tuple argument (truthy) rather than a
boolean assertion and a message
pull/413/head
Darryl Pogue 9 months ago committed by Adam Johnson
parent
commit
429a87e530
  1. 5
      korman/exporter/convert.py

5
korman/exporter/convert.py

@ -538,10 +538,9 @@ class Exporter:
# my_object.foo = bar # my_object.foo = bar
# ``` # ```
pre_result = proc(self, bo) pre_result = proc(self, bo)
assert ( assert \
inspect.isgenerator(pre_result) or pre_result is None, inspect.isgenerator(pre_result) or pre_result is None, \
"pre_export() should return a generator or None" "pre_export() should return a generator or None"
)
try: try:
gen_result = None gen_result = None
while pre_result is not None: while pre_result is not None:

Loading…
Cancel
Save