Skip to content

Commit

Permalink
Merge branch '3.0.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Oct 4, 2021
2 parents 647677d + fb9cac6 commit e20a52e
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.25.0
rev: v2.29.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
Expand All @@ -12,7 +12,7 @@ repos:
- id: reorder-python-imports
args: ["--application-directories", "src"]
- repo: https://github.com/psf/black
rev: 21.8b0
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand Down
2 changes: 1 addition & 1 deletion docs/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The usage of the ``i18n`` extension for template designers is covered in
:ref:`the template documentation <i18n-in-templates>`.

.. _gettext: https://docs.python.org/3/library/gettext.html
.. _Babel: http://babel.pocoo.org/
.. _Babel: https://babel.pocoo.org/


Whitespace Trimming
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ These distributions will not be installed automatically.

- `Babel`_ provides translation support in templates.

.. _Babel: http://babel.pocoo.org/
.. _Babel: https://babel.pocoo.org/
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if errorlevel 9009 (
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
echo.https://www.sphinx-doc.org/
exit /b 1
)

Expand Down
63 changes: 33 additions & 30 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
#
alabaster==0.7.12
# via sphinx
appdirs==1.4.4
# via virtualenv
attrs==21.2.0
# via pytest
babel==2.9.1
# via sphinx
certifi==2020.12.5
backports.entry-points-selectable==1.1.0
# via virtualenv
certifi==2021.5.30
# via requests
cfgv==3.3.0
cfgv==3.3.1
# via pre-commit
chardet==4.0.0
charset-normalizer==2.0.6
# via requests
click==8.0.1
# via pip-tools
distlib==0.3.1
distlib==0.3.3
# via virtualenv
docutils==0.17.1
# via sphinx
filelock==3.0.12
filelock==3.3.0
# via
# tox
# virtualenv
identify==2.2.4
identify==2.3.0
# via pre-commit
idna==2.10
idna==3.2
# via requests
imagesize==1.2.0
# via sphinx
Expand All @@ -40,92 +40,95 @@ jinja2==3.0.1
# via sphinx
markupsafe==2.0.1
# via jinja2
mypy==0.910
# via -r requirements/typing.in
mypy-extensions==0.4.3
# via mypy
mypy==0.910
# via -r requirements/typing.in
nodeenv==1.6.0
# via pre-commit
packaging==20.9
packaging==21.0
# via
# pallets-sphinx-themes
# pytest
# sphinx
# tox
pallets-sphinx-themes==2.0.1
# via -r requirements/docs.in
pep517==0.10.0
pep517==0.11.0
# via pip-tools
pip-tools==6.2.0
pip-tools==6.3.0
# via -r requirements/dev.in
pluggy==0.13.1
platformdirs==2.4.0
# via virtualenv
pluggy==1.0.0
# via
# pytest
# tox
pre-commit==2.14.1
pre-commit==2.15.0
# via -r requirements/dev.in
py==1.10.0
# via
# pytest
# tox
pygments==2.9.0
pygments==2.10.0
# via sphinx
pyparsing==2.4.7
# via packaging
pytest==6.2.5
# via -r requirements/tests.in
pytz==2021.1
pytz==2021.3
# via babel
pyyaml==5.4.1
# via pre-commit
requests==2.25.1
requests==2.26.0
# via sphinx
six==1.16.0
# via
# tox
# virtualenv
snowballstemmer==2.1.0
# via sphinx
sphinx==4.0.2
sphinx-issues==1.2.0
# via -r requirements/docs.in
sphinx==4.2.0
# via
# -r requirements/docs.in
# pallets-sphinx-themes
# sphinx-issues
# sphinxcontrib-log-cabinet
sphinx-issues==1.2.0
# via -r requirements/docs.in
sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-htmlhelp==2.0.0
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-log-cabinet==1.0.1
# via -r requirements/docs.in
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.4
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
toml==0.10.2
# via
# mypy
# pep517
# pre-commit
# pytest
# tox
tox==3.24.3
tomli==1.2.1
# via pep517
tox==3.24.4
# via -r requirements/dev.in
typing-extensions==3.10.0.0
typing-extensions==3.10.0.2
# via mypy
urllib3==1.26.4
urllib3==1.26.7
# via requests
virtualenv==20.4.6
virtualenv==20.8.1
# via
# pre-commit
# tox
wheel==0.36.2
wheel==0.37.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
Expand Down
22 changes: 11 additions & 11 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ alabaster==0.7.12
# via sphinx
babel==2.9.1
# via sphinx
certifi==2020.12.5
certifi==2021.5.30
# via requests
chardet==4.0.0
charset-normalizer==2.0.6
# via requests
docutils==0.17.1
# via sphinx
idna==2.10
idna==3.2
# via requests
imagesize==1.2.0
# via sphinx
jinja2==3.0.1
# via sphinx
markupsafe==2.0.1
# via jinja2
packaging==20.9
packaging==21.0
# via
# pallets-sphinx-themes
# sphinx
pallets-sphinx-themes==2.0.1
# via -r requirements/docs.in
pygments==2.9.0
pygments==2.10.0
# via sphinx
pyparsing==2.4.7
# via packaging
pytz==2021.1
pytz==2021.3
# via babel
requests==2.25.1
requests==2.26.0
# via sphinx
snowballstemmer==2.1.0
# via sphinx
sphinx-issues==1.2.0
# via -r requirements/docs.in
sphinx==4.0.2
sphinx==4.2.0
# via
# -r requirements/docs.in
# pallets-sphinx-themes
Expand All @@ -50,17 +50,17 @@ sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-htmlhelp==2.0.0
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-log-cabinet==1.0.1
# via -r requirements/docs.in
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.4
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
urllib3==1.26.4
urllib3==1.26.7
# via requests

# The following packages are considered to be unsafe in a requirements file:
Expand Down
4 changes: 2 additions & 2 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ attrs==21.2.0
# via pytest
iniconfig==1.1.1
# via pytest
packaging==20.9
packaging==21.0
# via pytest
pluggy==0.13.1
pluggy==1.0.0
# via pytest
py==1.10.0
# via pytest
Expand Down
6 changes: 3 additions & 3 deletions requirements/typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# pip-compile requirements/typing.in
#
mypy==0.910
# via -r requirements/typing.in
mypy-extensions==0.4.3
# via mypy
mypy==0.910
# via -r requirements/typing.in
toml==0.10.2
# via mypy
typing-extensions==3.10.0.0
typing-extensions==3.10.0.2
# via mypy
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ babel.extractors =
testpaths = tests
filterwarnings =
error
# Python 3.9 raises a deprecation from internal asyncio code.
ignore:The loop argument:DeprecationWarning:asyncio[.]base_events:542

[coverage:run]
branch = True
Expand Down
8 changes: 4 additions & 4 deletions src/jinja2/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,8 +1350,8 @@ def do_reverse(value: t.Union[str, t.Iterable[V]]) -> t.Union[str, t.Iterable[V]
rv = list(value)
rv.reverse()
return rv
except TypeError:
raise FilterArgumentError("argument must be iterable")
except TypeError as e:
raise FilterArgumentError("argument must be iterable") from e


@pass_environment
Expand Down Expand Up @@ -1691,7 +1691,7 @@ def prepare_map(
name = args[0]
args = args[1:]
except LookupError:
raise FilterArgumentError("map requires a filter argument")
raise FilterArgumentError("map requires a filter argument") from None

def func(item: t.Any) -> t.Any:
return context.environment.call_filter(
Expand All @@ -1712,7 +1712,7 @@ def prepare_select_or_reject(
try:
attr = args[0]
except LookupError:
raise FilterArgumentError("Missing parameter for attribute name")
raise FilterArgumentError("Missing parameter for attribute name") from None

transfunc = make_attrgetter(context.environment, attr)
off = 1
Expand Down
2 changes: 1 addition & 1 deletion src/jinja2/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def wrap(
)
except Exception as e:
msg = str(e).split(":")[-1].strip()
raise TemplateSyntaxError(msg, lineno, name, filename)
raise TemplateSyntaxError(msg, lineno, name, filename) from e
elif token == TOKEN_INTEGER:
value = int(value_str.replace("_", ""), 0)
elif token == TOKEN_FLOAT:
Expand Down
Loading

0 comments on commit e20a52e

Please sign in to comment.