Skip to content

Import / AttributeError error in new asyncio  #7266

@DrTom

Description

@DrTom

If some module imports with from uasyncio import * and then the this module
is imported somewhere else there will occur an AttributeError if e.g. start_server is invoked:

AttributeError: 'module' object has no attribute 'start_server'

The culprit is the "lazy loading" in: https://github.com/micropython/micropython/blob/master/extmod/uasyncio/__init__.py#L8-L30
Replacing the lazy loading with regular import solves the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    py-coreRelates to py/ directory in source

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions