From 022d6024f318abecb0e19c0ef3488f86c3f1fc47 Mon Sep 17 00:00:00 2001 From: Thomas Schank Date: Sat, 15 May 2021 22:07:00 +0200 Subject: [PATCH] asyncio: fix import fixes https://github.com/micropython/micropython/issues/7266 --- extmod/uasyncio/__init__.py | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/extmod/uasyncio/__init__.py b/extmod/uasyncio/__init__.py index fa64438f6b2a0..ae0ff87a06597 100644 --- a/extmod/uasyncio/__init__.py +++ b/extmod/uasyncio/__init__.py @@ -2,29 +2,9 @@ # MIT license; Copyright (c) 2019 Damien P. George from .core import * +from .stream import start_server, StreamReader, StreamWriter, open_connection +from .funcs import wait_for, wait_for_ms, gather +from .event import Event, ThreadSafeFlag +from .lock import Lock __version__ = (3, 0, 0) - -_attrs = { - "wait_for": "funcs", - "wait_for_ms": "funcs", - "gather": "funcs", - "Event": "event", - "ThreadSafeFlag": "event", - "Lock": "lock", - "open_connection": "stream", - "start_server": "stream", - "StreamReader": "stream", - "StreamWriter": "stream", -} - -# Lazy loader, effectively does: -# global attr -# from .mod import attr -def __getattr__(attr): - mod = _attrs.get(attr, None) - if mod is None: - raise AttributeError(attr) - value = getattr(__import__(mod, None, None, True, 1), attr) - globals()[attr] = value - return value 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