Skip to content

Commit dcbabf6

Browse files
committed
mypy 0.990 inspired fixes + 1 ignore
1 parent 4a6931b commit dcbabf6

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

cwltool/executors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def run_jobs(
228228
for job in jobiter:
229229
if job is not None:
230230
if runtime_context.builder is not None and hasattr(job, "builder"):
231-
job.builder = runtime_context.builder # type: ignore
231+
job.builder = runtime_context.builder
232232
if job.outdir is not None:
233233
self.output_dirs.add(job.outdir)
234234
if runtime_context.research_obj is not None:

cwltool/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,11 @@ def main(
13221322
runtime_context=runtimeContext,
13231323
)
13241324
except SystemExit as err:
1325-
return err.code
1325+
if isinstance(err.code, int):
1326+
return err.code
1327+
else:
1328+
_logger.debug("Non-integer SystemExit: %s", err.code)
1329+
return 1
13261330

13271331
del args.workflow
13281332
del args.job_order

mypy-stubs/rdflib/namespace/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ __all__ = [
3333

3434
class Namespace(str):
3535
@property
36-
def title(self) -> URIRef: ...
36+
def title(self) -> URIRef: ... # type: ignore[override]
3737
def term(self, name: Any) -> URIRef: ...
3838
def __getitem__(self, key: Any) -> URIRef: ...
3939
def __getattr__(self, name: str) -> URIRef: ...

tests/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import shutil
66
import subprocess
7+
import sys
78
from pathlib import Path
89
from typing import Dict, Generator, List, Mapping, Optional, Tuple, Union
910

@@ -107,7 +108,10 @@ def get_main_output(
107108
try:
108109
rc = main(argsl=args, stdout=stdout, stderr=stderr)
109110
except SystemExit as e:
110-
rc = e.code
111+
if isinstance(e.code, int):
112+
rc = e.code
113+
else:
114+
rc = sys.maxsize
111115
return (
112116
rc,
113117
stdout.getvalue(),

0 commit comments

Comments
 (0)