Skip to content

Conversation

@DavidSpickett
Copy link
Collaborator

All these modules got new names or were moved around in Python 3.0: https://docs.python.org/3/whatsnew/3.0.html#library-changes

LLVM requires Python >= 3.8 so we don't need to try Python2 naming.

…ew.py

All these modules got new names or were moved around in Python 3.0:
https://docs.python.org/3/whatsnew/3.0.html#library-changes

LLVM requires Python >= 3.8 so we don't need to try Python2 naming.
@DavidSpickett DavidSpickett requested a review from tru October 16, 2025 11:10
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 16, 2025
import time
import socket
import itertools
import configparser
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Reporter is a local module, I moved configparser above it.

@llvmbot
Copy link
Member

llvmbot commented Oct 16, 2025

@llvm/pr-subscribers-clang

Author: David Spickett (DavidSpickett)

Changes

All these modules got new names or were moved around in Python 3.0: https://docs.python.org/3/whatsnew/3.0.html#library-changes

LLVM requires Python >= 3.8 so we don't need to try Python2 naming.


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

1 Files Affected:

  • (modified) clang/tools/scan-view/share/ScanView.py (+4-24)
diff --git a/clang/tools/scan-view/share/ScanView.py b/clang/tools/scan-view/share/ScanView.py
index a89bf3f24fc5a..63c5bdff2afd8 100644
--- a/clang/tools/scan-view/share/ScanView.py
+++ b/clang/tools/scan-view/share/ScanView.py
@@ -1,39 +1,19 @@
-from __future__ import print_function
-
-try:
-    from http.server import HTTPServer, SimpleHTTPRequestHandler
-except ImportError:
-    from BaseHTTPServer import HTTPServer
-    from SimpleHTTPServer import SimpleHTTPRequestHandler
+from http.server import HTTPServer, SimpleHTTPRequestHandler
 import os
 import sys
-
-try:
-    from urlparse import urlparse
-    from urllib import unquote
-except ImportError:
-    from urllib.parse import urlparse, unquote
-
+from urllib.parse import urlparse, unquote
 import posixpath
-
-if sys.version_info.major >= 3:
-    from io import StringIO, BytesIO
-else:
-    from io import BytesIO, BytesIO as StringIO
-
+from io import StringIO, BytesIO
 import re
 import shutil
 import threading
 import time
 import socket
 import itertools
+import configparser
 
 import Reporter
 
-try:
-    import configparser
-except ImportError:
-    import ConfigParser as configparser
 
 ###
 # Various patterns matched or replaced by server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants