From 63e626ffe1a99a57e45b93b34b2a3b13c2b4f099 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:49:31 -0400 Subject: [PATCH] use Union instead of pipe for multiple return types --- src/reuse/report.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/reuse/report.py b/src/reuse/report.py index 364408478..508eb51ce 100644 --- a/src/reuse/report.py +++ b/src/reuse/report.py @@ -21,7 +21,17 @@ from io import StringIO from os import cpu_count from pathlib import Path, PurePath -from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Set, cast +from typing import ( + Any, + Dict, + Iterable, + List, + NamedTuple, + Optional, + Set, + Union, + cast, +) from uuid import uuid4 from . import __REUSE_version__, __version__ @@ -284,7 +294,7 @@ def get_lint_results( file_list: Optional[List[str]] = None, multiprocessing: bool = cpu_count() > 1, # type: ignore add_license_concluded: bool = False, - ) -> list | Iterable[_MultiprocessingResult]: + ) -> Union[list, Iterable[_MultiprocessingResult]]: """Get lint results based on multiprocessing and file_list.""" container = _MultiprocessingContainer( project, do_checksum, add_license_concluded