Skip to content

Commit 0e3a5f7

Browse files
author
Thomas Preud'homme
committed
[LNT] Remove Python2 support
This patch removes all the Python 3 compability imports, thus removing Python 2 support. Python 2 is no longer maintained since Jan 2020, a year and a half already. Perhaps it is time to remove Python 2 support in LNT. Reviewed By: cmatthews Differential Revision: https://reviews.llvm.org/D69056
1 parent 3f6e198 commit 0e3a5f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6
-109
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
from __future__ import print_function
1514
import datetime
1615
import sys
1716
import os

examples/functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Simple example of a test generator which just produces data on some
44
mathematical functions, keyed off of the current time.
55
"""
6-
from __future__ import print_function
76
from lnt.testing import Machine, Run, TestSamples, Report
87
import math
98
import random

examples/run_to_csv.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Convert the JSON run file passed on stdin to a csv"""
2-
from __future__ import print_function
32
import json
4-
53
import sys
64

75

lnt/external/stats/pstat.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@
105105
##
106106
## 11/08/98 ... fixed aput to output large arrays correctly
107107

108-
from __future__ import absolute_import
109-
from __future__ import print_function
110108
import string, copy
111109
from types import *
112110

lnt/external/stats/stats.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@
222222
## changed name of skewness and askewness to skew and askew
223223
## fixed (a)histogram (which sometimes counted points <lowerlimit)
224224

225-
from __future__ import absolute_import
226-
from __future__ import print_function
227-
from builtins import input
228225
from . import pstat # required 3rd party module
229226
import math, string, copy # required python modules
230227
from types import *

lnt/formats/PlistFormat2.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

lnt/formats/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
callable taking a Python object to write, and the path_or_file to write to.
88
"""
99

10-
from __future__ import absolute_import
1110
from typing import List, Dict
12-
try:
13-
from plistlib import readPlist # noqa: F401 # used to test exception
14-
from .PlistFormat2 import format as plist # for Python 2
15-
except ImportError:
16-
from .PlistFormat import format as plist # for Python 3
11+
from .PlistFormat import format as plist
1712
from .JSONFormat import format as json
1813

1914
formats = [plist, json] # type: List[Dict]

lnt/lnttool/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from __future__ import absolute_import
21
from .main import main # noqa: F401 # LNT entrypoint

lnt/lnttool/admin.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/usr/bin/env python
2-
from future import standard_library
3-
standard_library.install_aliases()
42
import click
53
from importlib import import_module
64
from .common import submit_options

lnt/lnttool/create.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import click
32
import platform
43

@@ -113,7 +112,6 @@ def action_create(instance_path, name, config, wsgi, tmp_dir, db_dir,
113112
* INSTANCE_PATH should point to a directory that will keep
114113
LNT configuration.
115114
"""
116-
from builtins import bytes
117115
from .common import init_logger
118116
import hashlib
119117
import lnt.server.db.migrate

0 commit comments

Comments
 (0)