lorien / test_server

Server to test HTTP clients
MIT License
4 stars 2 forks source link

Importing ABC directly from collections module was removed in Python 3.9 #23

Closed tirkarthi closed 2 years ago

tirkarthi commented 4 years ago

https://bugzilla.redhat.com/show_bug.cgi?id=1793021

https://github.com/lorien/test_server/blob/e46b5f4c0b38b9c98d90625407c91855f725ed5a/test_server/server.py#L9

Thanks for the library!

rapgro commented 4 years ago

Does this work instead?

import collections.defaultdict
import collections.Iterable
tirkarthi commented 4 years ago

The project also supports Python 2. So something like below would be better compatible.

try:
    # For Python 3.3+
    from collections.abc import Iterable
except ImportError:
    # For Python 2
    from collections import Iterable
rapgro commented 4 years ago

OK, thanks. Could you file this patch as a pull request?

tirkarthi commented 4 years ago

Thanks, raised https://github.com/lorien/test_server/pull/24.

rapgro commented 3 years ago

ping

lorien commented 2 years ago

Fixed.