`typing.NoReturn` was introduced in Python 3.5.4. Therefore, there are
releases of Python 3.5 with which we get errors like:
# Running: python3 /home/smarchi/src/babeltrace/tests/utils/python/mctf.py --base-dir /tmp/test-stored-value.jJOHoog/stored-values /home/smarchi/src/babeltrace/tests/data/ctf-traces/live/stored-values.mctf
Traceback (most recent call last):
File "/home/smarchi/src/babeltrace/tests/utils/python/mctf.py", line 13, in <module>
import normand
File "/home/smarchi/src/babeltrace/tests/utils/python/normand.py", line 61, in <module>
from typing import Any, Set, Dict, List, Union, Pattern, Callable, NoReturn, Optional
ImportError: cannot import name 'NoReturn'
Fix that by using our local typing module for Python 3.5.
Change-Id: I5660a5e0e2014a71c5e6b98b6ce1970b5bb1226e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11172
CI-Build: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
run_python() {
local our_pythonpath="${BT_TESTS_SRCDIR}/utils/python"
- if [[ $BT_TESTS_PYTHON_VERSION = 3.4 ]]; then
+ if [[ $BT_TESTS_PYTHON_VERSION =~ 3.[45] ]]; then
# Add a local directory containing a `typing.py` to `PYTHONPATH` for
# Python 3.4 which doesn't offer the `typing` module.
our_pythonpath="$our_pythonpath:${BT_TESTS_SRCDIR}/utils/python/typing"