Changeset 2661 for TI02-CSML


Ignore:
Timestamp:
29/06/07 09:49:37 (12 years ago)
Author:
domlowe
Message:

separating celementtree and elementtree imports - they may have been installed independently by different methods, so need separate tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/parser_extra.py

    r2642 r2661  
    1010import csml.parser 
    1111import sys 
     12 
     13#import ElementTree 
    1214try: #python 2.5 
    1315    from xml.etree import ElementTree as etree 
     16except ImportError: 
     17    try: 
     18        # if you've installed it yourself it comes this way 
     19        import ElementTree as etree 
     20    except ImportError: 
     21        # if you've egged it this is the way it comes 
     22        from elementtree import ElementTree as etree 
     23        
     24 
     25#now import cElementTree 
     26try: #python 2.5 
    1427    from xml.etree import cElementTree as ET 
    1528except ImportError: 
    1629    try: 
    1730        # if you've installed it yourself it comes this way 
    18         import ElementTree as etree 
    1931        import cElementTree as ET 
    2032    except ImportError: 
    2133        # if you've egged it this is the way it comes 
    22         from elementtree import ElementTree as etree 
    2334        from elementtree import cElementTree as ET 
     35         
    2436import string 
    2537import codecs 
Note: See TracChangeset for help on using the changeset viewer.