From e0cc26553f021c6c150ee204a4592e61438f6b01 Mon Sep 17 00:00:00 2001 From: James Socol Date: Mon, 30 May 2016 11:29:42 -0400 Subject: [PATCH] Standard importlib first --- .travis.yml | 1 + jingo/__init__.py | 6 +++++- tox.ini | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63a2c25..34f3679 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - TOX_ENV=py33-1.8 - TOX_ENV=py34-1.7 - TOX_ENV=py34-1.8 + - TOX_ENV=py35-1.8 install: - pip install tox script: diff --git a/jingo/__init__.py b/jingo/__init__.py index f6607f1..9e48991 100644 --- a/jingo/__init__.py +++ b/jingo/__init__.py @@ -10,7 +10,11 @@ from django.apps import apps from django.conf import settings from django.template.base import Origin, TemplateDoesNotExist from django.template.loader import BaseLoader -from django.utils.importlib import import_module + +try: + from importlib import import_module +except ImportError: + from django.utils.importlib import import_module try: import importlib.util diff --git a/tox.ini b/tox.ini index 3b1ced8..af5e634 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ commands = python run_tests.py deps = sphinx - jinja2==2.7 + jinja2 nose mock @@ -46,3 +46,9 @@ basepython = python3.4 deps = Django>=1.8,<1.9 {[testenv]deps} + +[testenv:py35-1.8] +basepython = python3.5 +deps = + Django>=1.8,<1.9 + {[testenv]deps}