Skip to content

Commit dff6377

Browse files
committed
fix type errors
1 parent 14ff9bd commit dff6377

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/trio/_core/_run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
PosArgT = TypeVarTuple("PosArgT")
7777
StatusT = TypeVar("StatusT", default=None)
7878
StatusT_contra = TypeVar("StatusT_contra", contravariant=True, default=None)
79+
BaseExcT = TypeVar("BaseExcT", bound=BaseException)
7980
else:
8081
from typing import TypeVar
8182

@@ -130,8 +131,9 @@ def _hypothesis_plugin_setup() -> None: # pragma: no cover
130131

131132
import trio.testing._raises_group
132133

133-
def repr_callable(fun: Callable[[BaseException], bool]) -> str:
134-
return "'" + get_pretty_function_description(fun) + "'"
134+
def repr_callable(fun: Callable[[BaseExcT], bool]) -> str:
135+
# add quotes around the signature
136+
return repr(get_pretty_function_description(fun))
135137

136138
trio.testing._raises_group.repr_callable = repr_callable
137139
except ImportError:

src/trio/testing/_raises_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def _match_pattern(match: Pattern[str]) -> str | Pattern[str]:
161161
return match.pattern if match.flags == _REGEX_NO_FLAGS else match
162162

163163

164-
def repr_callable(fun: Callable[[BaseException], bool]) -> str:
164+
def repr_callable(fun: Callable[[BaseExcT_1], bool]) -> str:
165165
"""Get the repr of a ``check`` parameter.
166166
167167
Split out so it can be monkeypatched (e.g. by our hypothesis plugin)

0 commit comments

Comments
 (0)