~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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