-import urllib
-import urlparse
-
-if hasattr(urlparse, 'parse_qs'):
- parse_qs = urlparse.parse_qs
-else:
- # Python <2.6 compatibility
- from cgi import parse_qs
-
-__all__ = ['ServiceTicket', 'LoginTicket']
+try:
+ from urllib.parse import urlencode, urlparse, parse_qs, ParseResult
+except ImportError:
+ from urllib import urlencode
+ from urlparse import urlparse, ParseResult
+ try:
+ from urlparse import parse_qs
+ except: # Python <2.6 compatibility
+ from cgi import parse_qs
+
+__all__ = ['ServiceTicket', 'LoginTicket', 'ProxyGrantingTicket', 'ProxyTicket', 'ProxyGrantingTicketIOU']