Skip to content

Commit 268565d

Browse files
committed
Rename uvloop._Loop -> uvloop.Loop
1 parent 570060a commit 268565d

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

docs/api/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ uvloop
1111
.. autoclass:: uvloop.EventLoopPolicy
1212
:members:
1313

14-
.. autoclass:: uvloop.loop.Loop
14+
.. autofunction:: uvloop.new_event_loop
15+
16+
.. autoclass:: uvloop.Loop
1517
:members:
1618
:undoc-members:
19+
:inherited-members:
1720

tests/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def test_default_exc_handler_broken(self):
311311
logger = logging.getLogger('asyncio')
312312
_context = None
313313

314-
class Loop(uvloop._Loop):
314+
class Loop(uvloop.Loop):
315315

316316
_selector = mock.Mock()
317317
_process_events = mock.Mock()
@@ -410,7 +410,7 @@ def test_uvloop_policy(self):
410410
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
411411
loop = asyncio.new_event_loop()
412412
try:
413-
self.assertIsInstance(loop, uvloop._Loop)
413+
self.assertIsInstance(loop, uvloop.Loop)
414414
finally:
415415
loop.close()
416416
finally:

tests/test_tcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def start_server():
5656
CNT = 0
5757

5858
addrs = ('127.0.0.1', 'localhost')
59-
if not isinstance(self.loop, uvloop._Loop):
59+
if not isinstance(self.loop, uvloop.Loop):
6060
# Hack to let tests run on Python 3.5.0
6161
# (asyncio doesn't support multiple hosts in 3.5.0)
6262
addrs = '127.0.0.1'

tests/test_udp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def datagram_received(self, data, addr):
4747
self.transport.sendto(b'resp:' + data, addr)
4848

4949
for lc in (('127.0.0.1', 0), None):
50-
if lc is None and not isinstance(self.loop, uvloop._Loop):
50+
if lc is None and not isinstance(self.loop, uvloop.Loop):
5151
# TODO This looks like a bug in asyncio -- if no local_addr
5252
# and no remote_addr are specified, the connection
5353
# that asyncio creates is not bound anywhere.

uvloop/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
__all__ = ('new_event_loop', 'EventLoopPolicy')
1010

1111

12-
class _Loop(__BaseLoop, asyncio.AbstractEventLoop):
12+
class Loop(__BaseLoop, asyncio.AbstractEventLoop):
1313
pass
1414

1515

1616
def new_event_loop():
1717
"""Return a new event loop."""
18-
return _Loop()
18+
return Loop()
1919

2020

2121
class EventLoopPolicy(__BasePolicy):
@@ -27,7 +27,7 @@ class EventLoopPolicy(__BasePolicy):
2727
>>> import uvloop
2828
>>> asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
2929
>>> asyncio.get_event_loop()
30-
<uvloop._Loop running=False closed=False debug=False>
30+
<uvloop.Loop running=False closed=False debug=False>
3131
"""
3232

3333
def _loop_factory(self):

0 commit comments

Comments
 (0)