Skip to content

Commit 5f6e7df

Browse files
committed
BUG: use Union in a type annotation
Pipes are python 3.9 syntax. While it's nice (type annotation *is* verbose and ugly), this is the only place which is not python 3.8 compatible, so it's not worth bumping the min version just for this single line.
1 parent 50c222a commit 5f6e7df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scipy_doctest/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import inspect
1111
from contextlib import contextmanager
1212

13-
from typing import Sequence
13+
from typing import Sequence, Union
1414

1515
from importlib.metadata import version as get_version, PackageNotFoundError
1616
from packaging.requirements import Requirement
@@ -259,7 +259,7 @@ def get_public_objects(module, skiplist=None):
259259
return (items, names), failures
260260

261261

262-
def is_req_satisfied(req_strs: str | Sequence[str]) -> bool:
262+
def is_req_satisfied(req_strs: Union[str, Sequence[str]]) -> bool:
263263
""" Check if all PEP 508-compliant requirement(s) are satisfied or not.
264264
"""
265265
req_strs = [req_strs] if isinstance(req_strs, str) else req_strs

0 commit comments

Comments
 (0)