Skip to content

Commit c50881a

Browse files
committed
type fixes
1 parent 2b01918 commit c50881a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cwltool/expression.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ def interpolate(scan, rootvars,
223223
return ''.join(parts)
224224

225225
def needs_parsing(snippet): # type: (Any) -> bool
226-
return isinstance(snippet, (Text)) and ("$(" in snippet or "${" in snippet)
226+
return isinstance(snippet, (str, Text)) \
227+
and ("$(" in snippet or "${" in snippet)
227228

228229
def do_eval(ex, jobinput, requirements, outdir, tmpdir, resources,
229230
context=None, pull_image=True, timeout=None, force_docker_pull=False,
@@ -240,6 +241,7 @@ def do_eval(ex, jobinput, requirements, outdir, tmpdir, resources,
240241
u"runtime": runtime}
241242

242243
if needs_parsing(ex):
244+
assert isinstance(ex, (str, Text))
243245
fullJS = False
244246
jslib = u""
245247
for r in reversed(requirements):

cwltool/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def var_spool_cwl_detector(obj, # type: Union[Dict, List, Text]
417417
r = var_spool_cwl_detector(value, obj, key) or r
418418
return r
419419

420-
def eval_resource(builder, resource_req):
420+
def eval_resource(builder, resource_req): # type: (Builder, Text) -> Any
421421
if expression.needs_parsing(resource_req):
422422
visit_class(builder.job, ("File",), add_sizes)
423423
return builder.do_eval(resource_req)

0 commit comments

Comments
 (0)