Skip to content

Commit

Permalink
str fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sorl committed Aug 27, 2015
1 parent fe40116 commit 524759f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -10,7 +10,7 @@ def run(self):

setup(
name='aino-utkik',
version='0.9.0',
version='0.9.1',
description='Small, clean code with a lazy view dispatcher and class based views for Django.',
long_description=open('README.rst').read(),
author='Mikko Hellsing',
Expand Down
7 changes: 0 additions & 7 deletions utkik/utils.py
Expand Up @@ -70,20 +70,13 @@ def import_string(import_name, silent=False):
`None` is returned instead.
:return: imported object
"""
# force the import name to automatically convert to strings
if isinstance(import_name, unicode):
import_name = str(import_name)
try:
if ':' in import_name:
module, obj = import_name.split(':', 1)
elif '.' in import_name:
module, obj = import_name.rsplit('.', 1)
else:
return __import__(import_name)
# __import__ is not able to handle unicode strings in the fromlist
# if the module is a package
if isinstance(obj, unicode):
obj = obj.encode('utf-8')
try:
return getattr(__import__(module, None, None, [obj]), obj)
except (ImportError, AttributeError):
Expand Down

0 comments on commit 524759f

Please sign in to comment.