From: Sebastian Spaeth Date: Fri, 30 Nov 2012 10:22:39 +0000 (+0100) Subject: Remove importlib (python2.7'ism) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=27886480abc83b52ce43b0c4637c6878700fbb0e;p=mediagoblin.git 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 --- diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index 22375b7f..e9fdfcb7 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -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