Commit Graph

9 Commits

Author SHA1 Message Date
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
Julian Oes b04f68553e Tools: use Python 3, improve import checks
In more detail:
- Change shebang to Python 3.
- Suggest installation using pip3 as user.
2020-01-16 16:25:26 +01:00
Julian Oes 19bd7b29d6 Tools: use Python3 for upload_log.py 2020-01-13 21:48:35 +00:00
Christian Clauss 6dc55f97d4 More fixes for Python 3 compatibility (#13008)
* More fixes for Python 3 compatibility

* Workaround if the six module is not pip installed

* Lose the semicolons
2019-12-19 02:05:55 -08:00
johannes 53effd5005 Tools/upload_log: change default upload to public flightreport 2019-03-18 09:52:18 -04:00
Beat Küng e3b61f22f2 Tools/upload_log.py: use https 2017-07-31 14:15:28 +02:00
Beat Küng 1e05520350 Tools/upload_log.py: add missing source parameter 2016-12-23 00:20:17 +01:00
Andreas Antener 30445ebd68 log upload: ignore error if we cannot get git email, really be quiet with -q except for printing the URL in the end 2016-12-13 10:20:14 +01:00
Beat Küng 9442c89691 Tools/upload_log.py: add script to upload ulog file to logs.px4.io 2016-12-09 17:57:29 +01:00