diff options
author | Cécile Tonglet <cecile.tonglet@gmail.com> | 2014-06-16 14:12:11 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2014-06-17 00:13:27 +0200 |
commit | 6b9fd63246838e66ff0bd4e89d8b93734bbf8f69 (patch) | |
tree | 265c006a347a16c8bd36269a08e7d1122f1a0279 /fastimport/processor.py | |
parent | d39687c83c01aa8d15b2cc1f72c5ec2c12dcc93f (diff) | |
download | python-fastimport-git-6b9fd63246838e66ff0bd4e89d8b93734bbf8f69.tar.gz |
Get handlers from class object using getattr() for possible inheritance
Issue #6: __dict__ stores only class' local variables and therefore it
can't find the handlers defined in the inherited classes.
Diffstat (limited to 'fastimport/processor.py')
-rw-r--r-- | fastimport/processor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fastimport/processor.py b/fastimport/processor.py index d71b98f..13aa987 100644 --- a/fastimport/processor.py +++ b/fastimport/processor.py @@ -78,7 +78,7 @@ class ImportProcessor(object): self.pre_process() for cmd in command_iter(): try: - handler = self.__class__.__dict__[cmd.name + "_handler"] + handler = getattr(self.__class__, cmd.name + "_handler") except KeyError: raise errors.MissingHandler(cmd.name) else: @@ -161,7 +161,7 @@ class CommitHandler(object): self.pre_process_files() for fc in self.command.iter_files(): try: - handler = self.__class__.__dict__[fc.name[4:] + "_handler"] + handler = getattr(self.__class__, fc.name[4:] + "_handler") except KeyError: raise errors.MissingHandler(fc.name) else: |