From f56f5888be456a4385df7ad45f3679fd1342b927 Mon Sep 17 00:00:00 2001 From: Kim Blomqvist Date: Sat, 30 Jan 2021 15:03:46 +0200 Subject: [PATCH] Fix compatibility issue with Jinja2 2.11.x gh-60 --- CHANGES.md | 2 +- setup.py | 6 ++---- yasha/cli.py | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3a442d0..f56ea6d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,7 +17,7 @@ Minor release (last with Python 2.7 support), 23 Aug 2020 - Fixed an exit code in case of undefined variable from 0 to 1. - Fixed a bug that caused extension classes not to load. - Quoted string variable with commas is not converted to list anymore (gh-57). -- Implemented workaround for Jinja 2.11 compatibility issue (gh-60) +- Implemented workaround for Jinja 2.11 compatibility issue (gh-60). - Added support for INI and CSV file parsing. - Fixed a bug that caused Yasha to crash when loading file extensions (regression likely caused by Click). diff --git a/setup.py b/setup.py index 32f8794..7e9e139 100644 --- a/setup.py +++ b/setup.py @@ -18,9 +18,10 @@ license="MIT", packages=find_packages(), include_package_data=True, + python_requires=">=3.5", install_requires=[ "Click", - "Jinja2<2.11", + "Jinja2>=2.11", "pytoml", "pyyaml", "xmltodict", @@ -31,9 +32,6 @@ yasha=yasha.cli:cli ''', classifiers=[ - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Code Generators", "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", diff --git a/yasha/cli.py b/yasha/cli.py index 0af98bc..b42842f 100644 --- a/yasha/cli.py +++ b/yasha/cli.py @@ -102,7 +102,7 @@ def load_extensions(file): import jinja2.defaults for name, obj in inspect.getmembers(module): - if name in jinja2.defaults.__all__: + if name in tuple(x for x in dir(jinja2.defaults) if x.isupper()): setattr(jinja2.defaults, name, obj) try: