uasyncio: Use builtin uerrno module.

pull/149/head
Paul Sokolovsky 2017-01-28 01:55:40 +03:00
rodzic 7043ee0702
commit 1bf1c74ae5
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
import errno import uerrno
import uselect as select import uselect as select
import usocket as _socket import usocket as _socket
from uasyncio.core import * from uasyncio.core import *
@ -48,7 +48,7 @@ class EpollEventLoop(EventLoop):
# and if that succeeds, yield IOWrite may never be called # and if that succeeds, yield IOWrite may never be called
# for that socket, and it will never be added to poller. So, # for that socket, and it will never be added to poller. So,
# ignore such error. # ignore such error.
if e.args[0] != errno.ENOENT: if e.args[0] != uerrno.ENOENT:
raise raise
def wait(self, delay): def wait(self, delay):
@ -183,7 +183,7 @@ def open_connection(host, port):
try: try:
s.connect(addr) s.connect(addr)
except OSError as e: except OSError as e:
if e.args[0] != errno.EINPROGRESS: if e.args[0] != uerrno.EINPROGRESS:
raise raise
if __debug__: if __debug__:
log.debug("open_connection: After connect") log.debug("open_connection: After connect")