Skip to content

Commit 430fa68

Browse files
author
Anton Khodak
committed
Fix mypy3 checks
1 parent c4ed587 commit 430fa68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cwltool/pack.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from schema_salad.ref_resolver import Loader
77
from six.moves import urllib
8+
from ruamel.yaml.comments import CommentedSeq, CommentedMap
89

910
from .process import shortname, uniquename
1011
import six
@@ -143,8 +144,11 @@ def rewrite_id(r, mainuri, document_packed=False):
143144
schemas = set() # type: Set[Text]
144145
for r in sorted(runs):
145146
dcr, metadata = document_loader.resolve_ref(r)
146-
if not isinstance(dcr, dict):
147+
if isinstance(dcr, CommentedSeq):
147148
dcr = dcr[0]
149+
dcr = cast(CommentedMap, dcr)
150+
if not isinstance(dcr, dict):
151+
continue
148152
for doc in (dcr, metadata):
149153
if "$schemas" in doc:
150154
for s in doc["$schemas"]:

0 commit comments

Comments
 (0)