Changeset 3551:6269046b0501 in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/31/08 10:35:00 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Make the xml_codec module importable even if the C module doesn't exist.

This makes the codec basically unusable, but at least expat can be used without
transcoding.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xml_codec.py

    r3263 r3551  
    1616import codecs 
    1717 
    18 from _xml_codec import detectencoding as _detectencoding, fixencoding as _fixencoding 
     18try: 
     19    from _xml_codec import detectencoding as _detectencoding, fixencoding as _fixencoding 
     20except ImportError: 
     21    def _detectencoding(input, final=False): 
     22        raise NotImplementedError("C module _xml_codec missing, _detectencoding() not supported") 
     23 
     24    def _fixencoding(input, encoding, final=False): 
     25        raise NotImplementedError("C module _xml_codec missing, _fixencoding() not supported") 
    1926 
    2027