Changeset 4460:9cf35d89abe0 in livinglogic.python.xist

Show
Ignore:
Timestamp:
04/08/11 15:05:13 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Tags:
rel-3-18
Message:

Protect against a missing xmlproc module.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/scripts/dtd2xsc.py

    r4459 r4460  
    118118    from xml.parsers.xmlproc import dtdparser 
    119119except ImportError: 
    120     from xmlproc import dtdparser 
     120    try: 
     121        from xmlproc import dtdparser 
     122    except ImportError: 
     123        dtdparser = None 
    121124 
    122125from ll import misc, url 
     
    143146def adddtd2xnd(ns, dtd): 
    144147    # Appends DTD information from :var:`dtd` to the :class:`xnd.Module` object 
    145     dtd = dtdparser.load_dtd_string(dtd) 
     148    dtd = dtdparser.load_dtd_string(dtd) # This requires ``xmlproc`` 
    146149 
    147150    # try to guess the namespace name from the dtd