Index: docs/tools/dump_ast_matchers.py =================================================================== --- docs/tools/dump_ast_matchers.py +++ docs/tools/dump_ast_matchers.py @@ -5,7 +5,10 @@ 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' Index: docs/tools/dump_format_style.py =================================================================== --- docs/tools/dump_format_style.py +++ docs/tools/dump_format_style.py @@ -6,7 +6,6 @@ import collections import os import re -import urllib2 CLANG_DIR = os.path.join(os.path.dirname(__file__), '../..') FORMAT_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Format/Format.h') Index: tools/scan-view/share/ScanView.py =================================================================== --- tools/scan-view/share/ScanView.py +++ tools/scan-view/share/ScanView.py @@ -3,7 +3,11 @@ from __future__ import print_function import os import sys -import urllib, urlparse +try: + from urllib import parse as urlparse, quote as urlquote, unquote as urlunquote +except ImportError: + from urllib.parse import parse as urlparse, quote as urlquote, unquote as urlunquote + import posixpath from io import StringIO @@ -194,8 +198,8 @@ value = '' else: name, value = chunk.split('=', 1) - name = urllib.unquote(name.replace('+', ' ')) - value = urllib.unquote(value.replace('+', ' ')) + name = urlunquote(name.replace('+', ' ')) + value = urlunquote(value.replace('+', ' ')) item = fields.get(name) if item is None: fields[name] = [value] @@ -650,9 +654,9 @@ 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(urlunquote(o.path)) # Split the components and strip the root prefix. components = path.split('/')[1:]