Skip to content

Commit bdfc8cf

Browse files
committed
Uniformize comments.
1 parent f17c11a commit bdfc8cf

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/websockets/asyncio/messages.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ async def get(self, decode: bool | None = None) -> Data:
141141

142142
self.get_in_progress = True
143143

144-
# Locking with get_in_progress prevents concurrent execution until
145-
# get() fetches a complete message or is cancelled.
144+
# Locking with get_in_progress prevents concurrent execution
145+
# until get() fetches a complete message or is cancelled.
146146

147147
try:
148148
# First frame
@@ -208,8 +208,8 @@ async def get_iter(self, decode: bool | None = None) -> AsyncIterator[Data]:
208208

209209
self.get_in_progress = True
210210

211-
# Locking with get_in_progress prevents concurrent execution until
212-
# get_iter() fetches a complete message or is cancelled.
211+
# Locking with get_in_progress prevents concurrent execution
212+
# until get_iter() fetches a complete message or is cancelled.
213213

214214
# If get_iter() raises an exception e.g. in decoder.decode(),
215215
# get_in_progress remains set and the connection becomes unusable.

src/websockets/sync/messages.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ def get(self, timeout: float | None = None, decode: bool | None = None) -> Data:
128128

129129
if self.get_in_progress:
130130
raise ConcurrencyError("get() or get_iter() is already running")
131-
132-
# Locking with get_in_progress ensures only one thread can get here.
133131
self.get_in_progress = True
134132

133+
# Locking with get_in_progress prevents concurrent execution
134+
# until get() fetches a complete message or times out.
135+
135136
try:
136137
deadline = Deadline(timeout)
137138

@@ -198,12 +199,10 @@ def get_iter(self, decode: bool | None = None) -> Iterator[Data]:
198199

199200
if self.get_in_progress:
200201
raise ConcurrencyError("get() or get_iter() is already running")
201-
202-
# Locking with get_in_progress ensures only one coroutine can get here.
203202
self.get_in_progress = True
204203

205-
# Locking with get_in_progress prevents concurrent execution until
206-
# get_iter() fetches a complete message or is cancelled.
204+
# Locking with get_in_progress prevents concurrent execution
205+
# until get_iter() fetches a complete message or times out.
207206

208207
# If get_iter() raises an exception e.g. in decoder.decode(),
209208
# get_in_progress remains set and the connection becomes unusable.

0 commit comments

Comments
 (0)