Skip to content

Commit

Permalink
Merge cc32875 into 1edfd5c
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidJiricek committed Apr 23, 2024
2 parents 1edfd5c + cc32875 commit c50a0b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/anyio/_core/_eventloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def get_async_backend(asynclib_name: str | None = None) -> AsyncBackend:
asynclib_name = sniffio.current_async_library()

modulename = "anyio._backends._" + asynclib_name
try:
module = sys.modules[modulename]
except KeyError:
module = sys.modules.get(modulename)
if not hasattr(module, "backend_class"):
# module is not loaded yet or it`s loaded only partially
module = import_module(modulename)

return getattr(module, "backend_class")

0 comments on commit c50a0b3

Please sign in to comment.