Skip to content

Commit 8d77cee

Browse files
committed
Simplify logic
1 parent f8fa0cf commit 8d77cee

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

uvloop/loop.pyx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,15 +1617,12 @@ cdef class Loop:
16171617
call_connection_made=False)
16181618

16191619
# Transfer buffered data from the old protocol to the new one.
1620-
stream_buff = None
1621-
if hasattr(protocol, '_stream_reader'):
1622-
stream_reader = protocol._stream_reader
1623-
if stream_reader is not None:
1624-
stream_buff = getattr(stream_reader, '_buffer', None)
1625-
1626-
if stream_buff is not None:
1627-
ssl_protocol._incoming.write(stream_buff)
1628-
stream_buff.clear()
1620+
stream_reader = getattr(protocol, '_stream_reader', None)
1621+
if stream_reader is not None:
1622+
stream_buff = getattr(stream_reader, '_buffer', None)
1623+
if stream_buff is not None:
1624+
ssl_protocol._incoming.write(stream_buff)
1625+
stream_buff.clear()
16291626

16301627
# Pause early so that "ssl_protocol.data_received()" doesn't
16311628
# have a chance to get called before "ssl_protocol.connection_made()".

0 commit comments

Comments
 (0)