Skip to content

Commit 429c916

Browse files
tetronmr-c
authored andcommitted
Fix this because the first fix was wrong. Darn.
1 parent d778d6b commit 429c916

File tree

3 files changed

+45
-45
lines changed

3 files changed

+45
-45
lines changed

cwl_utils/parser_v1_0.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -408,23 +408,23 @@ def __init__(self, inner, scoped_id, vocab_term, scoped_ref):
408408
def load(self, doc, baseuri, loadingOptions, docRoot=None):
409409
# type: (Any, str, LoadingOptions, Optional[str]) -> Any
410410
if isinstance(doc, MutableSequence):
411-
doc = []
411+
newdoc = []
412412
for i in doc:
413-
if not isinstance(i, str):
414-
raise ValidationException(
415-
f"Expected a list of strings, but item was {type(i)}"
416-
)
417-
doc.append(
418-
expand_url(
419-
i,
420-
baseuri,
421-
loadingOptions,
422-
self.scoped_id,
423-
self.vocab_term,
424-
self.scoped_ref,
413+
if isinstance(i, str):
414+
newdoc.append(
415+
expand_url(
416+
i,
417+
baseuri,
418+
loadingOptions,
419+
self.scoped_id,
420+
self.vocab_term,
421+
self.scoped_ref,
422+
)
425423
)
426-
)
427-
if isinstance(doc, str):
424+
else:
425+
newdoc.append(i)
426+
doc = newdoc
427+
elif isinstance(doc, str):
428428
doc = expand_url(
429429
doc,
430430
baseuri,

cwl_utils/parser_v1_1.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -408,23 +408,23 @@ def __init__(self, inner, scoped_id, vocab_term, scoped_ref):
408408
def load(self, doc, baseuri, loadingOptions, docRoot=None):
409409
# type: (Any, str, LoadingOptions, Optional[str]) -> Any
410410
if isinstance(doc, MutableSequence):
411-
doc = []
411+
newdoc = []
412412
for i in doc:
413-
if not isinstance(i, str):
414-
raise ValidationException(
415-
f"Expected a list of strings, but item was {type(i)}"
416-
)
417-
doc.append(
418-
expand_url(
419-
i,
420-
baseuri,
421-
loadingOptions,
422-
self.scoped_id,
423-
self.vocab_term,
424-
self.scoped_ref,
413+
if isinstance(i, str):
414+
newdoc.append(
415+
expand_url(
416+
i,
417+
baseuri,
418+
loadingOptions,
419+
self.scoped_id,
420+
self.vocab_term,
421+
self.scoped_ref,
422+
)
425423
)
426-
)
427-
if isinstance(doc, str):
424+
else:
425+
newdoc.append(i)
426+
doc = newdoc
427+
elif isinstance(doc, str):
428428
doc = expand_url(
429429
doc,
430430
baseuri,

cwl_utils/parser_v1_2.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -408,23 +408,23 @@ def __init__(self, inner, scoped_id, vocab_term, scoped_ref):
408408
def load(self, doc, baseuri, loadingOptions, docRoot=None):
409409
# type: (Any, str, LoadingOptions, Optional[str]) -> Any
410410
if isinstance(doc, MutableSequence):
411-
doc = []
411+
newdoc = []
412412
for i in doc:
413-
if not isinstance(i, str):
414-
raise ValidationException(
415-
f"Expected a list of strings, but item was {type(i)}"
416-
)
417-
doc.append(
418-
expand_url(
419-
i,
420-
baseuri,
421-
loadingOptions,
422-
self.scoped_id,
423-
self.vocab_term,
424-
self.scoped_ref,
413+
if isinstance(i, str):
414+
newdoc.append(
415+
expand_url(
416+
i,
417+
baseuri,
418+
loadingOptions,
419+
self.scoped_id,
420+
self.vocab_term,
421+
self.scoped_ref,
422+
)
425423
)
426-
)
427-
if isinstance(doc, str):
424+
else:
425+
newdoc.append(i)
426+
doc = newdoc
427+
elif isinstance(doc, str):
428428
doc = expand_url(
429429
doc,
430430
baseuri,

0 commit comments

Comments
 (0)