Skip to content

Commit 17bfe6c

Browse files
author
Peter Amstutz
committed
Fix checker
1 parent 279cb02 commit 17bfe6c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cwltool/checker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections import namedtuple
2-
from typing import Any, Dict, List, Optional
2+
from typing import Any, Dict, List, Optional, MutableMapping
33
from typing_extensions import Text # pylint: disable=unused-import
44
# move to a regular typing import when Python 3.3-3.6 is no longer supported
55

@@ -15,7 +15,7 @@
1515

1616
def _get_type(tp):
1717
# type: (Any) -> Any
18-
if isinstance(tp, dict):
18+
if isinstance(tp, MutableMapping):
1919
if tp.get("type") not in ("array", "record", "enum"):
2020
return tp["type"]
2121
return tp
@@ -48,7 +48,7 @@ def merge_flatten_type(src):
4848

4949
if isinstance(src, list):
5050
return [merge_flatten_type(t) for t in src]
51-
if isinstance(src, dict) and src.get("type") == "array":
51+
if isinstance(src, MutableMapping) and src.get("type") == "array":
5252
return src
5353
return {"items": src, "type": "array"}
5454

@@ -65,7 +65,7 @@ def can_assign_src_to_sink(src, sink, strict=False): # type: (Any, Any, bool) -
6565

6666
if src == "Any" or sink == "Any":
6767
return True
68-
if isinstance(src, dict) and isinstance(sink, dict):
68+
if isinstance(src, MutableMapping) and isinstance(sink, MutableMapping):
6969
if sink.get("not_connected") and strict:
7070
return False
7171
if src["type"] == "array" and sink["type"] == "array":

0 commit comments

Comments
 (0)