bernardopires/django-tenant-schemas — pull request #179 by rev112 (2014-09-02 13:33:33+00:00)
Title: Fix minor Py3 issues

Fix a couple of fixes that allows to run the module on Py3.

**About 'postgresql_backend/base.py':**
Before changing, I was getting the following error under Py3:

```
. . .
File "C:\Python34\lib\importlib\__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Python34\lib\site-packages\django_tenant_schemas-1.4.8_3_g7e7f19a-py3.4.egg\tenant_schemas\postgresql_backend\base.py", line 11, in
original_backend = import_module('.base', ORIGINAL_BACKEND)
File "C:\Python34\lib\importlib\__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2249, in _gcd_import
File "", line 2199, in _sanity_check
SystemError: Parent module 'django.db.backends.postgresql_psycopg2' not loaded, cannot perform relative import
```
Looks like Py3 does not import the second argument ('package') of `import_module` automatically, hence the errro. Here's what the doc says (https://docs.python.org/3.2/library/importlib.html?highlight=import_module#importlib.import_module):

```
The import_module() function acts as a simplifying wrapper around importlib.__import__(). This means all
semantics of the function are derived from importlib.__import__(), including requiring the package from which
an import is occurring to have been previously imported (i.e., package must already be imported)
```