~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml8.py

  • Committer: Benjamin Peterson
  • Date: 2009-03-07 20:45:34 UTC
  • mto: (4090.2.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4094.
  • Revision ID: benjamin@python.org-20090307204534-5sxqxn5di37bquae
compare types with 'is' not ==

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
    # to check if None, rather than try/KeyError
93
93
    text = _map.get(unicode_or_utf8_str)
94
94
    if text is None:
95
 
        if unicode_or_utf8_str.__class__ == unicode:
 
95
        if unicode_or_utf8_str.__class__ is unicode:
96
96
            # The alternative policy is to do a regular UTF8 encoding
97
97
            # and then escape only XML meta characters.
98
98
            # Performance is equivalent once you use cache_utf8. *However*
128
128
    # This is fairly optimized because we know what cElementTree does, this is
129
129
    # not meant as a generic function for all cases. Because it is possible for
130
130
    # an 8-bit string to not be ascii or valid utf8.
131
 
    if a_str.__class__ == unicode:
 
131
    if a_str.__class__ is unicode:
132
132
        return _encode_utf8(a_str)
133
133
    else:
134
134
        return intern(a_str)