From 429a87e5302547ccc41fa26612c13c32b2e4abc3 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 10 Mar 2024 22:30:05 -0700 Subject: [PATCH] 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 --- korman/exporter/convert.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/korman/exporter/convert.py b/korman/exporter/convert.py index bace2de..644e100 100644 --- a/korman/exporter/convert.py +++ b/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: