Merge pull request #15 from paltman/develop

Use import_module from standard library if exists
This commit is contained in:
Jannis Leidel
2015-02-15 13:23:03 +01:00
3 changed files with 11 additions and 4 deletions

View File

@@ -5,8 +5,6 @@ python:
- "3.2"
- "3.3"
before_install:
- export PIP_USE_MIRRORS=true
- export PIP_INDEX_URL=https://simple.crate.io/
- export DJANGO_SETTINGS_MODULE=appconf.test_settings
install:
- pip install -e .
@@ -21,6 +19,7 @@ env:
- DJANGO=1.3.7
- DJANGO=1.4.5
- DJANGO=1.5.1
- DJANGO=1.7.4
- DJANGO=master
matrix:
@@ -33,3 +32,7 @@ matrix:
env: DJANGO=1.3.7
- python: "3.3"
env: DJANGO=1.4.5
- python: "2.6"
env: DJANGO=1.7.4
- python: "2.6"
env: DJANGO=master

View File

@@ -2,4 +2,5 @@ Christopher Grebs
Jannis Leidel
Matthew Tretter
Rafal Stozek
Chris Streeter
Chris Streeter
Patrick Altman

View File

@@ -2,7 +2,10 @@ import sys
def import_attribute(import_path, exception_handler=None):
from django.utils.importlib import import_module
try:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module
module_name, object_name = import_path.rsplit('.', 1)
try:
module = import_module(module_name)