Skip to content

Commit e5d0b38

Browse files
[clang][tools][scan-view] Remove Python2 compatibility code in ScanView.py (#163747)
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.
1 parent b81a992 commit e5d0b38

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

clang/tools/scan-view/share/ScanView.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
1-
from __future__ import print_function
2-
3-
try:
4-
from http.server import HTTPServer, SimpleHTTPRequestHandler
5-
except ImportError:
6-
from BaseHTTPServer import HTTPServer
7-
from SimpleHTTPServer import SimpleHTTPRequestHandler
1+
from http.server import HTTPServer, SimpleHTTPRequestHandler
82
import os
93
import sys
10-
11-
try:
12-
from urlparse import urlparse
13-
from urllib import unquote
14-
except ImportError:
15-
from urllib.parse import urlparse, unquote
16-
4+
from urllib.parse import urlparse, unquote
175
import posixpath
18-
19-
if sys.version_info.major >= 3:
20-
from io import StringIO, BytesIO
21-
else:
22-
from io import BytesIO, BytesIO as StringIO
23-
6+
from io import StringIO, BytesIO
247
import re
258
import shutil
269
import threading
2710
import time
2811
import socket
2912
import itertools
13+
import configparser
3014

3115
import Reporter
32-
import configparser
3316

3417
###
3518
# Various patterns matched or replaced by server.

0 commit comments

Comments
 (0)