mbedtls/scripts/mbedtls_dev
Gilles Peskine 4fbffcd144 Do not require typing_extensions at runtime
There are type annotations that indirectly depend on the
typing_extensions module (on Python 3.5-3.7: Protocol was added to the
core typing module in 3.8). The typing_extensions module is not
installed by default, so the code didn't run on a pristine Python
installation.

To avoid depending on a non-default module, make the dependency on
typing_extensions optional. (It's still required to run mypy, but
installing mypy takes care of providing typing_extensions.) If it
isn't available, provide a substitute definition that's just good
enough to get the scripts to run.

Move this ugly code to its own module to avoid the temptation of
spreading such ugliness all over the place. It's likely to be used in
other modules anyway.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-02-17 14:58:29 +01:00
..
asymmetric_key_data.py Add some randomly generated keys 2021-02-17 14:50:17 +01:00
c_build_helper.py Minor documentation fixes 2021-01-19 21:23:11 +01:00
crypto_knowledge.py Improve documentation of crypto_knowledge.KeyType 2021-02-17 14:58:29 +01:00
macro_collector.py Check if the last word is 'MASK', not if it ends with 'MASK' 2021-02-17 14:50:16 +01:00
test_case.py Do not require typing_extensions at runtime 2021-02-17 14:58:29 +01:00
typing_util.py Do not require typing_extensions at runtime 2021-02-17 14:58:29 +01:00