Skip to content

Commit 7da5f40

Browse files
committed
Declare __await__ as coroutine.
Python 3.7 requires this.
1 parent 595e3f0 commit 7da5f40

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Changelog
1818

1919
Also:
2020

21+
* Added compatibility with Python 3.7.
22+
2123
* :func:`~client.connect()` performs HTTP Basic Auth when the URI contains
2224
credentials.
2325

@@ -126,6 +128,8 @@ Also:
126128
3.3
127129
...
128130

131+
* Ensured compatibility with Python 3.6.
132+
129133
* Reduced noise in logs caused by connection resets.
130134

131135
* Avoided crashing on concurrent writes on slow connections.

websockets/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def __aenter__(self):
393393
def __aexit__(self, exc_type, exc_value, traceback):
394394
yield from self.ws_client.close()
395395

396+
@asyncio.coroutine
396397
def __await__(self):
397398
transport, protocol = yield from self._creating_connection
398399

websockets/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ def __aexit__(self, exc_type, exc_value, traceback):
738738
self.ws_server.close()
739739
yield from self.ws_server.wait_closed()
740740

741+
@asyncio.coroutine
741742
def __await__(self):
742743
server = yield from self._creating_server
743744
self.ws_server.wrap(server)

0 commit comments

Comments
 (0)