[clang] [clang][docs] Remove Python2 import handler in dump_ast_matchers.py (PR #163730)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 16 03:08:41 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

LLVM requires Python >=3.8 and in Python 3.0 urllib2 was renamed to urllib.

https://docs.python.org/3/whatsnew/3.0.html#library-changes

---
Full diff: https://github.com/llvm/llvm-project/pull/163730.diff


1 Files Affected:

- (modified) clang/docs/tools/dump_ast_matchers.py (+1-4) 


``````````diff
diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py
index 46b7bb718ba08..5db6826070934 100755
--- a/clang/docs/tools/dump_ast_matchers.py
+++ b/clang/docs/tools/dump_ast_matchers.py
@@ -6,11 +6,8 @@
 import collections
 import re
 import os
+from urllib.request import urlopen
 
-try:
-    from urllib.request import urlopen
-except ImportError:
-    from urllib2 import urlopen
 
 CLASS_INDEX_PAGE_URL = "https://clang.llvm.org/doxygen/classes.html"
 try:

``````````

</details>


https://github.com/llvm/llvm-project/pull/163730


More information about the cfe-commits mailing list