px4-firmware/Tools/serial
Julian Oes 9a96ca14be Tools: make Python import error more readable
The problem with printing the exception was that starting with
Python 3.6 the ImportError is yet another (sub) exception called
ModuleNotFoundError which can't be printed as a string and then triggers
another exception:

```
Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 11, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 13, in <module>
    print("Failed to import jinja2: " + e)
TypeError: must be str, not ModuleNotFoundError
```

As per @bkueng's suggestion the easiest is to cast the exception to str
and that way prevent the second exception.
2020-02-14 11:40:05 +01:00
..
generate_config.py Tools: make Python import error more readable 2020-02-14 11:40:05 +01:00
rc.serial.jinja Tools: fix style consistency in shell scripts "if [...]; then" 2019-02-24 11:20:38 -05:00
rc.serial_port.jinja Tools: fix style consistency in shell scripts "if [...]; then" 2019-02-24 11:20:38 -05:00
serial_params.c.jinja @value will be printed with Whitespace in start of line for serial_config parameters 2019-10-02 10:34:10 +02:00