Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/zmq/backend/select.py: 69%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Import basic exposure of libzmq C API as a backend"""
3# Copyright (C) PyZMQ Developers
4# Distributed under the terms of the Modified BSD License.
6from importlib import import_module
8public_api = [
9 'Context',
10 'Socket',
11 'Frame',
12 'Message',
13 'proxy',
14 'proxy_steerable',
15 'zmq_poll',
16 'strerror',
17 'zmq_errno',
18 'has',
19 'curve_keypair',
20 'curve_public',
21 'zmq_version_info',
22 'IPC_PATH_MAX_LEN',
23 'PYZMQ_DRAFT_API',
24]
27def select_backend(name: str) -> dict:
28 """Select the pyzmq backend"""
29 try:
30 mod = import_module(name)
31 except ImportError:
32 raise
33 except Exception as e:
34 raise ImportError(f"Importing {name} failed with {e}") from e
35 ns = {
36 # private API
37 'monitored_queue': mod.monitored_queue,
38 }
39 ns.update({key: getattr(mod, key) for key in public_api})
40 return ns