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:
parent
e4f33f4093
commit
27886480ab
@ -27,8 +27,6 @@ These functions now live here and get "mixed in" into the
|
|||||||
real objects.
|
real objects.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import importlib
|
|
||||||
|
|
||||||
from mediagoblin import mg_globals
|
from mediagoblin import mg_globals
|
||||||
from mediagoblin.auth import lib as auth_lib
|
from mediagoblin.auth import lib as auth_lib
|
||||||
from mediagoblin.tools import common, licenses
|
from mediagoblin.tools import common, licenses
|
||||||
@ -126,7 +124,7 @@ class MediaEntryMixin(object):
|
|||||||
else:
|
else:
|
||||||
# no thumbnail in media available. Get the media's
|
# no thumbnail in media available. Get the media's
|
||||||
# MEDIA_MANAGER for the fallback icon and return static URL
|
# 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 = manager.MEDIA_MANAGER[u'default_thumb']
|
||||||
thumb_url = mg_globals.app.staticdirector(thumb_url) # use static
|
thumb_url = mg_globals.app.staticdirector(thumb_url) # use static
|
||||||
return thumb_url
|
return thumb_url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user