Remove importlib (python2.7'ism)

importlib is cool, but only included in python2.7 which is beyond our
minimum python version that we support. So simply use plain old
__import__.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-11-30 11:22:39 +01:00
parent e4f33f4093
commit 27886480ab

View File

@ -27,8 +27,6 @@ These functions now live here and get "mixed in" into the
real objects.
"""
import importlib
from mediagoblin import mg_globals
from mediagoblin.auth import lib as auth_lib
from mediagoblin.tools import common, licenses
@ -126,7 +124,7 @@ class MediaEntryMixin(object):
else:
# no thumbnail in media available. Get the media's
# MEDIA_MANAGER for the fallback icon and return static URL
manager = importlib.import_module(self.media_type)
manager = __import__(self.media_type)
thumb_url = manager.MEDIA_MANAGER[u'default_thumb']
thumb_url = mg_globals.app.staticdirector(thumb_url) # use static
return thumb_url