Skip to content

Commit 022d602

Browse files
committed
asyncio: fix import
fixes #7266
1 parent 605b74f commit 022d602

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

extmod/uasyncio/__init__.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,9 @@
22
# MIT license; Copyright (c) 2019 Damien P. George
33

44
from .core import *
5+
from .stream import start_server, StreamReader, StreamWriter, open_connection
6+
from .funcs import wait_for, wait_for_ms, gather
7+
from .event import Event, ThreadSafeFlag
8+
from .lock import Lock
59

610
__version__ = (3, 0, 0)
7-
8-
_attrs = {
9-
"wait_for": "funcs",
10-
"wait_for_ms": "funcs",
11-
"gather": "funcs",
12-
"Event": "event",
13-
"ThreadSafeFlag": "event",
14-
"Lock": "lock",
15-
"open_connection": "stream",
16-
"start_server": "stream",
17-
"StreamReader": "stream",
18-
"StreamWriter": "stream",
19-
}
20-
21-
# Lazy loader, effectively does:
22-
# global attr
23-
# from .mod import attr
24-
def __getattr__(attr):
25-
mod = _attrs.get(attr, None)
26-
if mod is None:
27-
raise AttributeError(attr)
28-
value = getattr(__import__(mod, None, None, True, 1), attr)
29-
globals()[attr] = value
30-
return value

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy