import collections
import re
-import urllib2
+try:
+ from urllib.request import urlopen
+except ImportError:
+ from urllib2 import urlopen
MATCHERS_FILE = '../../include/clang/ASTMatchers/ASTMatchers.h'
if url not in doxygen_probes:
try:
print('Probing %s...' % url)
- urllib2.urlopen(url)
+ urlopen(url)
doxygen_probes[url] = True
except:
doxygen_probes[url] = False
import posixpath
import threading
import time
-import urllib
+try:
+ from urllib.request import urlopen
+except ImportError:
+ from urllib2 import urlopen
import webbrowser
# How long to wait for server to start.
def url_is_up(url):
try:
- o = urllib.urlopen(url)
+ o = urlopen(url)
except IOError:
return False
o.close()
def start_browser(port, options):
- import urllib
import webbrowser
url = 'http://%s:%d' % (options.host, port)
from SimpleHTTPServer import SimpleHTTPRequestHandler
import os
import sys
-import urllib, urlparse
+try:
+ from urlparse import urlparse
+ from urllib import unquote
+except ImportError:
+ from urllib.parse import urlparse, unquote
+
import posixpath
import StringIO
import re
value = ''
else:
name, value = chunk.split('=', 1)
- name = urllib.unquote(name.replace('+', ' '))
- value = urllib.unquote(value.replace('+', ' '))
+ name = unquote(name.replace('+', ' '))
+ value = unquote(value.replace('+', ' '))
item = fields.get(name)
if item is None:
fields[name] = [value]
fields = {}
self.fields = fields
- o = urlparse.urlparse(self.path)
+ o = urlparse(self.path)
self.fields = parse_query(o.query, fields)
- path = posixpath.normpath(urllib.unquote(o.path))
+ path = posixpath.normpath(unquote(o.path))
# Split the components and strip the root prefix.
components = path.split('/')[1:]