Permalink
Browse files

Merge pull request #16 from jsalz/master

Fix for issue #15 (importing)
  • Loading branch information...
joshmarshall committed Oct 26, 2013
2 parents e3a3cde + 865a813 commit 53c8ffcfe4dd1718086cc551dce8ac459e8abc67
Showing with 7 additions and 0 deletions.
  1. +7 −0 jsonrpclib/jsonclass.py
View
@@ -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

0 comments on commit 53c8ffc

Please sign in to comment.