Skip to content

Commit 5232c2a

Browse files
committed
workaround for a mypy 1.17 regression
1 parent 2a444c3 commit 5232c2a

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

cwltool/command_line_tool.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from enum import Enum
1717
from functools import cmp_to_key, partial
1818
from re import Pattern
19-
from typing import TYPE_CHECKING, Any, Optional, TextIO, Union, cast
19+
from typing import TYPE_CHECKING, Any, Iterable, Optional, TextIO, Union, cast
2020

2121
from mypy_extensions import mypyc_attr
2222
from ruamel.yaml.comments import CommentedMap, CommentedSeq
@@ -1322,26 +1322,29 @@ def collect_output(
13221322
key=cmp_to_key(locale.strcoll),
13231323
)
13241324
r.extend(
1325-
[
1326-
{
1327-
"location": g,
1328-
"path": fs_access.join(
1329-
builder.outdir,
1330-
urllib.parse.unquote(g[len(prefix[0]) + 1 :]),
1331-
),
1332-
"basename": decoded_basename,
1333-
"nameroot": os.path.splitext(decoded_basename)[0],
1334-
"nameext": os.path.splitext(decoded_basename)[1],
1335-
"class": "File" if fs_access.isfile(g) else "Directory",
1336-
}
1337-
for g, decoded_basename in zip(
1338-
sorted_glob_result,
1339-
map(
1340-
lambda x: os.path.basename(urllib.parse.unquote(x)),
1325+
cast(
1326+
Iterable[CWLOutputType],
1327+
[
1328+
{
1329+
"location": g,
1330+
"path": fs_access.join(
1331+
builder.outdir,
1332+
urllib.parse.unquote(g[len(prefix[0]) + 1 :]),
1333+
),
1334+
"basename": decoded_basename,
1335+
"nameroot": os.path.splitext(decoded_basename)[0],
1336+
"nameext": os.path.splitext(decoded_basename)[1],
1337+
"class": "File" if fs_access.isfile(g) else "Directory",
1338+
}
1339+
for g, decoded_basename in zip(
13411340
sorted_glob_result,
1342-
),
1343-
)
1344-
]
1341+
map(
1342+
lambda x: os.path.basename(urllib.parse.unquote(x)),
1343+
sorted_glob_result,
1344+
),
1345+
)
1346+
],
1347+
)
13451348
)
13461349
except OSError as e:
13471350
_logger.warning(str(e), exc_info=builder.debug)

0 commit comments

Comments
 (0)