jparise/python-reloader — pull request #20 by kouk (2014-06-17 10:01:57+00:00)
Title: support import of modules under packages missing attributes

In some cases a package is loaded that doesn't have all it's descendants
as attributes. When importing a descendant with `fromlist == None` then
an `AttributeError` is thrown in `_import`. This is the case for example
when importing `django.template.defaulttags`.

The proposed fix is to use `sys.modules` with the full name of the
immediate ancestor of the module, but only if the current method trows
an `AttributeError`.