Skip to content

Commit fa3359e

Browse files
author
Peter Amstutz
committed
Use Text type
1 parent 50be795 commit fa3359e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cwltool/pack.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
from .process import scandeps, shortname
77

8-
from typing import Union, Any, cast, Callable, Dict, Tuple, Type, IO
8+
from typing import Union, Any, cast, Callable, Dict, Tuple, Type, IO, Text
99

10-
def flatten_deps(d, files): # type: (Any, Set[unicode]) -> None
10+
def flatten_deps(d, files): # type: (Any, Set[Text]) -> None
1111
if isinstance(d, list):
1212
for s in d:
1313
flatten_deps(s, files)
@@ -16,7 +16,7 @@ def flatten_deps(d, files): # type: (Any, Set[unicode]) -> None
1616
if "secondaryFiles" in d:
1717
flatten_deps(d["secondaryFiles"], files)
1818

19-
def find_run(d, runs): # type: (Any, Set[unicode]) -> None
19+
def find_run(d, runs): # type: (Any, Set[Text]) -> None
2020
if isinstance(d, list):
2121
for s in d:
2222
find_run(s, runs)
@@ -27,7 +27,7 @@ def find_run(d, runs): # type: (Any, Set[unicode]) -> None
2727
find_run(s, runs)
2828

2929
def replace_refs(d, rewrite, stem, newstem):
30-
# type: (Any, Dict[unicode, unicode], unicode, unicode) -> None
30+
# type: (Any, Dict[Text, Text], Text, Text) -> None
3131
if isinstance(d, list):
3232
for s,v in enumerate(d):
3333
if isinstance(v, (str, unicode)) and v.startswith(stem):
@@ -45,16 +45,16 @@ def replace_refs(d, rewrite, stem, newstem):
4545
replace_refs(v, rewrite, stem, newstem)
4646

4747
def pack(document_loader, processobj, uri, metadata):
48-
# type: (Loader, Union[Dict[unicode, Any], List[Dict[unicode, Any]]], unicode, Dict[unicode, unicode]) -> Dict[unicode, Any]
48+
# type: (Loader, Union[Dict[Text, Any], List[Dict[Text, Any]]], Text, Dict[Text, Text]) -> Dict[Text, Any]
4949
def loadref(b, u):
50-
# type: (unicode, unicode) -> Union[Dict, List, unicode]
50+
# type: (Text, Text) -> Union[Dict, List, Text]
5151
return document_loader.resolve_ref(u, base_url=b)[0]
5252
deps = scandeps(uri, processobj, set(("run",)), set(), loadref)
5353

5454
fdeps = set((uri,))
5555
flatten_deps(deps, fdeps)
5656

57-
runs = set() # type: Set[unicode]
57+
runs = set() # type: Set[Text]
5858
for f in fdeps:
5959
find_run(document_loader.idx[f], runs)
6060

@@ -69,9 +69,9 @@ def loadref(b, u):
6969
rewrite[r] = "#" + shortname(r)
7070

7171
packed = {"$graph": [], "cwlVersion": metadata["cwlVersion"]
72-
} # type: Dict[unicode, Any]
72+
} # type: Dict[Text, Any]
7373
for r,v in rewrite.items():
74-
dc = cast(Dict[unicode, Any], copy.deepcopy(document_loader.idx[r]))
74+
dc = cast(Dict[Text, Any], copy.deepcopy(document_loader.idx[r]))
7575
dc["id"] = v
7676
for n in ("name", "package", "cwlVersion"):
7777
if n in dc:

0 commit comments

Comments
 (0)