Skip to content

Commit ca50633

Browse files
committed
Work around strange mypy type inference
1 parent 0e82410 commit ca50633

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cwltool/executors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import threading
66
from abc import ABCMeta, abstractmethod
77
import datetime
8-
from typing import Any, Dict, List, Optional, Set, Tuple
8+
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple
99
from typing_extensions import Text # pylint: disable=unused-import
1010
# move to a regular typing import when Python 3.3-3.6 is no longer supported
1111

@@ -97,11 +97,11 @@ def execute(self,
9797
path_mapper=runtime_context.path_mapper)
9898

9999
if runtime_context.rm_tmpdir:
100-
cachedir = runtime_context.cachedir
101-
if cachedir is not None:
102-
cleanIntermediate(filter(lambda x: not x.startswith(cachedir), self.output_dirs))
100+
if runtime_context.cachedir is None:
101+
output_dirs = self.output_dirs # type: Iterable[Any]
103102
else:
104-
cleanIntermediate(self.output_dirs)
103+
output_dirs = filter(lambda x: not x.startswith(runtime_context.cachedir), self.output_dirs)
104+
cleanIntermediate(output_dirs)
105105

106106
if self.final_output and self.final_status:
107107

0 commit comments

Comments
 (0)