~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-15 11:25:40 UTC
  • mfrom: (5436.2.9 hooks-refactoring)
  • mto: This revision was merged to the branch mainline in revision 5500.
  • Revision ID: v.ladeuil+lp@free.fr-20101015112540-vhgyone6ou1g0foo
Merge lp:~spiv/bzr/hooks-refactoring with tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from StringIO import StringIO
22
22
import re
23
23
 
24
 
import bzrlib.errors as errors
 
24
from bzrlib import (
 
25
    errors,
 
26
    pyutils,
 
27
    )
25
28
from bzrlib.diff import internal_diff
26
29
from bzrlib.revision import NULL_REVISION
27
30
# For backwards-compatibility
191
194
    :param overwrite: Should this version override a default
192
195
    """
193
196
    def _loader(version):
194
 
        mod = __import__(module, globals(), locals(), [classname])
195
 
        klass = getattr(mod, classname)
 
197
        klass = pyutils.get_named_object(module, classname)
196
198
        return klass(version)
197
199
    register(version, _loader, overwrite=overwrite)
198
200