Skip to content

Commit 0c3e0b5

Browse files
committed
style: add None checks to expression
1 parent e81a092 commit 0c3e0b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cwltool/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def next_seg(parsed_string, remaining_string, current_value): # type: (Text, Te
132132
elif next_segment_str[1] in ("'", '"'):
133133
key = next_segment_str[2:-2].replace("\\'", "'").replace('\\"', '"')
134134

135-
if key:
135+
if key is not None:
136136
if isinstance(current_value, MutableSequence) and key == "length" and not remaining_string[m.end(0):]:
137137
return len(current_value)
138138
if not isinstance(current_value, MutableMapping):
@@ -172,7 +172,7 @@ def evaluator(ex, # type: Text
172172
expression_parse_exception = None
173173
expression_parse_succeeded = False
174174

175-
if match:
175+
if match is not None:
176176
first_symbol = match.group(1)
177177
first_symbol_end = match.end(1)
178178

0 commit comments

Comments
 (0)