Browse Source

urllib and urlparse imports for python3 compatibility

main
Julien Iguchi-Cartigny 10 years ago
parent
commit
b92a45ea49
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      wstools/Utility.py

+ 11
- 2
wstools/Utility.py View File

@@ -26,8 +26,17 @@ from string import join, strip, split
from UserDict import UserDict
from cStringIO import StringIO
from TimeoutSocket import TimeoutSocket, TimeoutError
from urlparse import urlparse
from httplib import HTTPConnection, HTTPSConnection

try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse

try:
from httplib import HTTPConnection, HTTPSConnection
except ImportError:
from http.client import HTTPConnection, HTTPSConnection

from exceptions import Exception
try:
from ZSI import _get_idstr


Loading…
Cancel
Save