Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Commit

Permalink
#8: fix __import__ usage for python2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Jun 9, 2010
1 parent a671e02 commit 9dea44e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion djangoratings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def lazy_object(location):
def inner(*args, **kwargs):
parts = location.rsplit('.', 1)
warnings.warn('`djangoratings.%s` is deprecated. Please use `%s` instead.' % (parts[1], location), DeprecationWarning)
imp = __import__(parts[0], globals(), locals(), [parts[1]], -1)
try:
imp = __import__(parts[0], globals(), locals(), [parts[1]], -1)
except:
imp = __import__(parts[0], globals(), locals(), [parts[1]])
func = getattr(imp, parts[1])
if callable(func):
return func(*args, **kwargs)
Expand Down

0 comments on commit 9dea44e

Please sign in to comment.