From a28d9a08e74c4650fe0ff82b9808e124bc08c55d Mon Sep 17 00:00:00 2001 From: David Spickett Date: Thu, 16 Oct 2025 11:08:09 +0000 Subject: [PATCH] [clang][tools][scan-view] Remove Python2 compatibility code in ScanView.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. --- clang/tools/scan-view/share/ScanView.py | 28 ++++--------------------- 1 file changed, 4 insertions(+), 24 deletions(-) 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.