Skip to content

Commit c40d0c8

Browse files
committed
- r use callable()
This works around a mypy limitation. See python/mypy#14928 and python/mypy#3060
1 parent f280bbb commit c40d0c8

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

approvaltests/scrubbers/scrubbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def create_regex_scrubber(
1313
) -> Scrubber:
1414
if isinstance(function_or_replace_string, str):
1515
return lambda t: _replace_regex(t, regex, lambda _: function_or_replace_string)
16-
elif isinstance(function_or_replace_string, abc.Callable):
16+
elif callable(function_or_replace_string):
1717
return lambda t: _replace_regex(t, regex, function_or_replace_string)
1818
else:
1919
raise TypeError(

mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ disable_error_code = arg-type
1414
[mypy-approvaltests.namer.inline_comparator]
1515
disable_error_code = no-any-return
1616

17-
[mypy-approvaltests.scrubbers.scrubbers]
18-
disable_error_code = arg-type
19-
2017
[mypy-approvaltests.reporters.default_reporter_factory]
2118
disable_error_code = no-any-return
2219

0 commit comments

Comments
 (0)