Mercurial > libervia-backend
comparison sat/tools/common/template.py @ 3061:948833e3b542
tools (common/template): removed warning catches, jinja2>=2.10.3 now handles them correctly
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 18 Oct 2019 17:51:44 +0200 |
parents | 5f3068915686 |
children | 9d0df638c8b4 |
comparison
equal
deleted
inserted
replaced
3060:730bbed77a89 | 3061:948833e3b542 |
---|---|
48 ) | 48 ) |
49 else: | 49 else: |
50 sat_templates # to avoid pyflakes warning | 50 sat_templates # to avoid pyflakes warning |
51 | 51 |
52 try: | 52 try: |
53 import warnings | 53 import jinja2 |
54 | |
55 with warnings.catch_warnings(): | |
56 warnings.filterwarnings("ignore", category=DeprecationWarning) | |
57 import jinja2 | |
58 jinja2_version = tuple([int(n) for n in jinja2.__version__.split('.')]) | |
59 if jinja2_version > (2, 10, 1): | |
60 log.warning("New jinja2 version available, warnings catches can be removed") | |
61 except: | 54 except: |
62 raise exceptions.MissingModule( | 55 raise exceptions.MissingModule( |
63 "Missing module jinja2, please install it from http://jinja.pocoo.org or with " | 56 "Missing module jinja2, please install it from http://jinja.pocoo.org or with " |
64 "pip install jinja2" | 57 "pip install jinja2" |
65 ) | 58 ) |