Skip to content

Commit 2d26396

Browse files
committed
Move asyncio compatibility to a new package.
1 parent d271022 commit 2d26396

File tree

8 files changed

+6
-6
lines changed

8 files changed

+6
-6
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ branch = true
4747
omit = [
4848
# */websockets matches src/websockets and .tox/**/site-packages/websockets
4949
"*/websockets/__main__.py",
50-
"*/websockets/legacy/async_timeout.py",
51-
"*/websockets/legacy/compatibility.py",
50+
"*/websockets/asyncio/async_timeout.py",
51+
"*/websockets/asyncio/compatibility.py",
5252
"tests/maxi_cov.py",
5353
]
5454

src/websockets/asyncio/__init__.py

Whitespace-only changes.

src/websockets/legacy/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
cast,
1717
)
1818

19+
from ..asyncio.compatibility import asyncio_timeout
1920
from ..datastructures import Headers, HeadersLike
2021
from ..exceptions import (
2122
InvalidHandshake,
@@ -40,7 +41,6 @@
4041
from ..http import USER_AGENT
4142
from ..typing import ExtensionHeader, LoggerLike, Origin, Subprotocol
4243
from ..uri import WebSocketURI, parse_uri
43-
from .compatibility import asyncio_timeout
4444
from .handshake import build_request, check_response
4545
from .http import read_response
4646
from .protocol import WebSocketCommonProtocol

src/websockets/legacy/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
cast,
2424
)
2525

26+
from ..asyncio.compatibility import asyncio_timeout
2627
from ..datastructures import Headers
2728
from ..exceptions import (
2829
ConnectionClosed,
@@ -49,7 +50,6 @@
4950
)
5051
from ..protocol import State
5152
from ..typing import Data, LoggerLike, Subprotocol
52-
from .compatibility import asyncio_timeout
5353
from .framing import Frame
5454

5555

src/websockets/legacy/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
cast,
2222
)
2323

24+
from ..asyncio.compatibility import asyncio_timeout
2425
from ..datastructures import Headers, HeadersLike, MultipleValuesError
2526
from ..exceptions import (
2627
AbortHandshake,
@@ -42,7 +43,6 @@
4243
from ..http import USER_AGENT
4344
from ..protocol import State
4445
from ..typing import ExtensionHeader, LoggerLike, Origin, StatusLike, Subprotocol
45-
from .compatibility import asyncio_timeout
4646
from .handshake import build_response, check_request
4747
from .http import read_request
4848
from .protocol import WebSocketCommonProtocol

tests/legacy/test_client_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import urllib.request
1515
import warnings
1616

17+
from websockets.asyncio.compatibility import asyncio_timeout
1718
from websockets.datastructures import Headers
1819
from websockets.exceptions import (
1920
ConnectionClosed,
@@ -30,7 +31,6 @@
3031
from websockets.frames import CloseCode
3132
from websockets.http import USER_AGENT
3233
from websockets.legacy.client import *
33-
from websockets.legacy.compatibility import asyncio_timeout
3434
from websockets.legacy.handshake import build_response
3535
from websockets.legacy.http import read_response
3636
from websockets.legacy.server import *

0 commit comments

Comments
 (0)