Skip to content

Commit

Permalink
Merge pull request #16 from jsalz/master
Browse files Browse the repository at this point in the history
Fix for issue #15 (importing)
  • Loading branch information
joshmarshall committed Oct 26, 2013
2 parents e3a3cde + 865a813 commit 53c8ffc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jsonrpclib/jsonclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ def load(obj):
except ImportError:
raise TranslationError('Could not import %s from module %s.' %
(json_class_name, json_module_tree))

# The returned class is the top-level module, not the one we really
# want. (E.g., if we import a.b.c, we now have a.) Walk through other
# path components to get to b and c.
for i in json_module_parts[1:]:
temp_module = getattr(temp_module, i)

json_class = getattr(temp_module, json_class_name)
# Creating the object...
new_obj = None
Expand Down

0 comments on commit 53c8ffc

Please sign in to comment.