Better handing of python2 and SAX

svn: r120
This commit is contained in:
Don Allingham
2001-06-12 23:24:46 +00:00
parent a0d9323557
commit 38cb929abb
5 changed files with 66 additions and 41 deletions

View File

@@ -20,6 +20,7 @@
import string
import os
import sys
import xml.sax
import xml.sax.saxutils
import utils
@@ -29,12 +30,14 @@ import utils
# Try to abstract SAX1 from SAX2
#
#-------------------------------------------------------------------------
try:
import xml.sax.saxexts
sax = 1
except:
if sys.version[0] != '1':
sax = 2
else:
try:
import xml.sax.saxexts
sax = 1
except:
sax = 2
FONT_SANS_SERIF = 0
FONT_SERIF = 1