Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collections.abc should get imported explicitly #62

Closed
SzieberthAdam opened this issue Jul 16, 2015 · 2 comments
Closed

collections.abc should get imported explicitly #62

SzieberthAdam opened this issue Jul 16, 2015 · 2 comments

Comments

@SzieberthAdam
Copy link
Collaborator

Currently some of the failures of the unittests are involving that abc is not part of the collections module since version 3.3.

https://docs.python.org/3/library/collections.abc.html#module-collections.abc

“New in version 3.3: Formerly, this module was part of the collections module.”

======================================================================
ERROR: test_protocol_custom_request_headers_list (websockets.test_client_server.SSLClientServerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/adam/github/notmy/websockets/websockets/test_client_server.py", line 97, in test_protocol_custom_request_headers_list
    self.start_client('raw_headers', extra_headers=[('X-Spam', 'Eggs')])
  File "/home/adam/github/notmy/websockets/websockets/test_client_server.py", line 279, in start_client
    self.client = self.loop.run_until_complete(client)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 316, in run_until_complete
    return future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 275, in result
    raise self._exception
  File "/usr/lib/python3.4/asyncio/tasks.py", line 238, in _step
    result = next(coro)
  File "/home/adam/github/notmy/websockets/websockets/client.py", line 143, in connect
    extra_headers=extra_headers)
  File "/home/adam/github/notmy/websockets/websockets/client.py", line 53, in handshake
    if isinstance(extra_headers, collections.abc.Mapping):
AttributeError: 'module' object has no attribute 'abc'

collections.abc should get explicitly imported in client.py and server.py.

import collections
import collections.abc
@aaugustin
Copy link
Member

In fact, these modules should just import collections.abc instead of import collections.

@SzieberthAdam
Copy link
Collaborator Author

Well, I missed that. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants