summaryrefslogtreecommitdiff
path: root/src/lxml/ElementInclude.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lxml/ElementInclude.py')
-rw-r--r--src/lxml/ElementInclude.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lxml/ElementInclude.py b/src/lxml/ElementInclude.py
index 471893fa..a0224bb3 100644
--- a/src/lxml/ElementInclude.py
+++ b/src/lxml/ElementInclude.py
@@ -52,12 +52,18 @@ form of custom URL resolvers.
from lxml import etree
import copy
-from urlparse import urljoin
-from urllib2 import urlopen
+try:
+ from urlparse import urljoin
+ from urllib2 import urlopen
+except ImportError:
+ # Python 3
+ from urllib.parse import urljoin
+ from urllib.request import urlopen
try:
set
except NameError:
+ # Python 2.3
from sets import Set as set
XINCLUDE = "{http://www.w3.org/2001/XInclude}"