Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 2.1 compatibility #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion django_babel/extract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# -*- coding: utf-8 -*-
from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
try:
# Django >= 2.1
from django.template.base import Lexer, TokenType
TOKEN_TEXT = TokenType.TEXT
TOKEN_VAR = TokenType.VAR
TOKEN_BLOCK = TokenType.BLOCK
except ImportError:
# Django < 2.1
from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK

tsouvarev marked this conversation as resolved.
Show resolved Hide resolved
from django.utils.translation import trim_whitespace
from django.utils.encoding import smart_text

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{35,36}-djangomaster, py{27,34,35,36}-django{18,111,20}, lint, docs
envlist = py{35,36,37}-django{21,master}, py{27,34,35,36}-django{18,111,20}, lint, docs

[testenv]
deps =
Expand All @@ -11,6 +11,7 @@ deps =
django18: Django>=1.8,<1.9
django111: Django>=1.11,<2.0
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
djangomaster: https://github.com/django/django/archive/master.tar.gz#egg=Django
commands = py.test {posargs}

Expand Down