summaryrefslogtreecommitdiffstats
path: root/docs/tools/dump_ast_matchers.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tools/dump_ast_matchers.py')
-rwxr-xr-xdocs/tools/dump_ast_matchers.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/tools/dump_ast_matchers.py b/docs/tools/dump_ast_matchers.py
index 2c0cbafa8a..c96c1ca27a 100755
--- a/docs/tools/dump_ast_matchers.py
+++ b/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'
@@ -41,8 +44,8 @@ def esc(text):
url = 'https://clang.llvm.org/doxygen/classclang_1_1%s.html' % name
if url not in doxygen_probes:
try:
- print 'Probing %s...' % url
- urllib2.urlopen(url)
+ print('Probing %s...' % url)
+ urlopen(url)
doxygen_probes[url] = True
except:
doxygen_probes[url] = False
@@ -307,14 +310,14 @@ def act_on_decl(declaration, comment, allowed_types):
if not result_types:
if not comment:
# Only overloads don't have their own doxygen comments; ignore those.
- print 'Ignoring "%s"' % name
+ print('Ignoring "%s"' % name)
else:
- print 'Cannot determine result type for "%s"' % name
+ print('Cannot determine result type for "%s"' % name)
else:
for result_type in result_types:
add_matcher(result_type, name, args, comment)
else:
- print '*** Unparsable: "' + declaration + '" ***'
+ print('*** Unparsable: "' + declaration + '" ***')
def sort_table(matcher_type, matcher_map):
"""Returns the sorted html table for the given row map."""