fix(test): replace collections.Callable, removed in Python 3.10 (#347)
test_client_try_import used `isinstance(x, collections.Callable)`.
`collections.Callable` has been an alias for `collections.abc.Callable`
since 3.3 and was removed in 3.10, so the test raises:
AttributeError: module 'collections' has no attribute 'Callable'
The suite therefore only passes on Python <= 3.9. .travis.yml tests
3.5/3.6/3.7, which is why this was never noticed -- and Travis has not
run on this repo for a long time either.
Uses the builtin `callable()` instead of `collections.abc.Callable`:
same semantics (collections.abc.Callable.__subclasshook__ just checks
for __call__), and it drops the now-unused `collections` import rather
than keeping one around for a single predicate.
Verified on Python 3.11.9:
before 1 failed, 47 passed, 37 skipped
after 48 passed, 37 skipped E
Episkey committed
b4bcbb0e8dc1bfa71023b2cc4128b9076c1fcfbc
Parent: a6dacfc
Committed by GitHub <noreply@github.com>
on 8/18/2026, 10:43:45 AM