Commit 3b4b376b authored by Claude Paroz's avatar Claude Paroz
Browse files

Revert "[1.5.x] Fixed #21335 -- Use importlib from python3 when using python3"

This reverts commit 1ef73741.
This would require changing some import_module calls (relative
syntax, see ec0a3f50), too much for a stable release.
parent 1ef73741
Loading
Loading
Loading
Loading
+17 −22
Original line number Diff line number Diff line
# Taken from Python 2.7 with permission from/by the original author.
import sys

from django.utils import six

def _resolve_name(name, package, level):
    """Return the absolute name of the module to be imported."""
    if not hasattr(package, 'rindex'):
@@ -17,9 +15,6 @@ def _resolve_name(name, package, level):
    return "%s.%s" % (package[:dot], name)


if six.PY3:
    from importlib import import_module
else:
def import_module(name, package=None):
    """Import a module.