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
master
Darryl Pogue 2 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
# ```
pre_result = proc(self, bo)
assert (
inspect.isgenerator(pre_result) or pre_result is None,
assert \
inspect.isgenerator(pre_result) or pre_result is None, \
"pre_export() should return a generator or None"
)
try:
gen_result = None
while pre_result is not None:

Loading…
Cancel
Save