Skip to content

Commit

Permalink
Further simplified the implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed May 10, 2024
1 parent 1b8ad98 commit 10b173a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/anyio/_core/_eventloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ def get_async_backend(asynclib_name: str | None = None) -> type[AsyncBackend]:
# We use our own dict instead of sys.modules to get the already imported back-end
# class because the appropriate modules in sys.modules could potentially be only
# partially initialized
modulename = "anyio._backends._" + asynclib_name
try:
return loaded_backends[asynclib_name]
except KeyError:
module = import_module(modulename)
module = import_module(f"anyio._backends._{asynclib_name}")
loaded_backends[asynclib_name] = module.backend_class
return module.backend_class

0 comments on commit 10b173a

Please sign in to comment.