[Lldb-commits] [lldb] e634c2f - [lldb] Remove use of __future__ in python

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 14 14:15:50 PDT 2023


Author: Alex Langford
Date: 2023-08-14T14:14:48-07:00
New Revision: e634c2f7149392b62e93c1b2b75701a12bc06721

URL: https://github.com/llvm/llvm-project/commit/e634c2f7149392b62e93c1b2b75701a12bc06721
DIFF: https://github.com/llvm/llvm-project/commit/e634c2f7149392b62e93c1b2b75701a12bc06721.diff

LOG: [lldb] Remove use of __future__ in python

These were useful primarily for the Python 2 to 3 transition. Python 2
is no longer supported so these are no longer necessary.

Differential Revision: https://reviews.llvm.org/D157759

Added: 
    

Modified: 
    lldb/docs/conf.py
    lldb/packages/Python/lldbsuite/support/gmodules.py
    lldb/packages/Python/lldbsuite/test/__init__.py
    lldb/packages/Python/lldbsuite/test/bench.py
    lldb/packages/Python/lldbsuite/test/configuration.py
    lldb/packages/Python/lldbsuite/test/decorators.py
    lldb/packages/Python/lldbsuite/test/dotest.py
    lldb/packages/Python/lldbsuite/test/dotest_args.py
    lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
    lldb/packages/Python/lldbsuite/test/lldbbench.py
    lldb/packages/Python/lldbsuite/test/lldbinline.py
    lldb/packages/Python/lldbsuite/test/lldbpexpect.py
    lldb/packages/Python/lldbsuite/test/lldbplatform.py
    lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
    lldb/packages/Python/lldbsuite/test/lldbtest.py
    lldb/packages/Python/lldbsuite/test/lldbutil.py
    lldb/packages/Python/lldbsuite/test/test_categories.py
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
    lldb/scripts/android/host_art_bt.py
    lldb/third_party/Python/module/progress/progress.py
    lldb/third_party/Python/module/unittest2/unittest2/test/test_result.py
    lldb/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py
    lldb/tools/intel-features/intel-mpx/test/TestMPXTable.py
    lldb/utils/lui/lldbutil.py

Removed: 
    


################################################################################
diff  --git a/lldb/docs/conf.py b/lldb/docs/conf.py
index 50d45f2971f550..7c4c945f25babe 100644
--- a/lldb/docs/conf.py
+++ b/lldb/docs/conf.py
@@ -10,8 +10,6 @@
 #
 # All configuration values have a default; values that are commented out
 # serve to show the default.
-from __future__ import print_function
-
 import sys, os, re, shutil
 from datetime import date
 

diff  --git a/lldb/packages/Python/lldbsuite/support/gmodules.py b/lldb/packages/Python/lldbsuite/support/gmodules.py
index 80213092e67fb5..81185a56422667 100644
--- a/lldb/packages/Python/lldbsuite/support/gmodules.py
+++ b/lldb/packages/Python/lldbsuite/support/gmodules.py
@@ -1,6 +1,3 @@
-from __future__ import absolute_import
-from __future__ import print_function
-
 # System modules
 import os
 import re

diff  --git a/lldb/packages/Python/lldbsuite/test/__init__.py b/lldb/packages/Python/lldbsuite/test/__init__.py
index 93971c2f2364be..b7390580876b7e 100644
--- a/lldb/packages/Python/lldbsuite/test/__init__.py
+++ b/lldb/packages/Python/lldbsuite/test/__init__.py
@@ -1,7 +1,5 @@
 # Module level initialization for the `lldbsuite.test` module.
 
-from __future__ import absolute_import
-
 from . import dotest
 
 run_suite = dotest.run_suite

diff  --git a/lldb/packages/Python/lldbsuite/test/bench.py b/lldb/packages/Python/lldbsuite/test/bench.py
index 3fe301f36d1a7e..1a11b3ef4f0e64 100644
--- a/lldb/packages/Python/lldbsuite/test/bench.py
+++ b/lldb/packages/Python/lldbsuite/test/bench.py
@@ -12,9 +12,6 @@
     ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
 """
 
-from __future__ import print_function
-from __future__ import absolute_import
-
 import os
 from optparse import OptionParser
 

diff  --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 0085117b954202..2a4b9b3c070c7f 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -7,9 +7,6 @@
 how this invocation of the test suite should be run.
 """
 
-from __future__ import absolute_import
-from __future__ import print_function
-
 # System modules
 import os
 

diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index b9ac170b84df9b..5562130aa34079 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1,5 +1,3 @@
-from __future__ import absolute_import
-
 # System modules
 from distutils.version import LooseVersion
 from functools import wraps

diff  --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 1b2076f593932d..a27d8cf321f829 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -18,9 +18,6 @@
 for available options.
 """
 
-from __future__ import absolute_import
-from __future__ import print_function
-
 # System modules
 import atexit
 import datetime

diff  --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index ae0228524322e2..70a65078f1d3a8 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -1,5 +1,3 @@
-from __future__ import absolute_import
-
 # System modules
 import argparse
 import sys

diff  --git a/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py b/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
index b4b120b22d3d96..3b746c3f9242df 100644
--- a/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
+++ b/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
@@ -11,9 +11,6 @@
 Provides helper support for adding lldb test paths to the python path.
 """
 
-from __future__ import print_function
-from __future__ import absolute_import
-
 # System modules
 import os
 import platform

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbbench.py b/lldb/packages/Python/lldbsuite/test/lldbbench.py
index 139f5f1a18dac1..3be05602f7e6fe 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbbench.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbbench.py
@@ -1,5 +1,3 @@
-from __future__ import absolute_import
-
 # System modules
 import time
 

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbinline.py b/lldb/packages/Python/lldbsuite/test/lldbinline.py
index 6fb23eec6bb3e6..ae38ab9d8c9d72 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -1,6 +1,3 @@
-from __future__ import print_function
-from __future__ import absolute_import
-
 # System modules
 import os
 import textwrap

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
index b95b0e8abcadbd..85102db7d0a053 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py
@@ -1,5 +1,3 @@
-from __future__ import absolute_import
-
 # System modules
 import os
 import sys

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbplatform.py b/lldb/packages/Python/lldbsuite/test/lldbplatform.py
index fdf50303f7a4bc..bdde973cb64502 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatform.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatform.py
@@ -1,7 +1,5 @@
 """ This module represents an abstraction of an lldb target / host platform. """
 
-from __future__ import absolute_import
-
 # System modules
 import itertools
 

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index 4570c513b8c839..2ecfe527e0f251 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -1,8 +1,6 @@
 """ This module contains functions used by the test cases to hide the
 architecture and/or the platform dependent nature of the tests. """
 
-from __future__ import absolute_import
-
 # System modules
 import itertools
 import re

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 376d4ac90e6587..49355d61911837 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -27,9 +27,6 @@
 $
 """
 
-from __future__ import absolute_import
-from __future__ import print_function
-
 # System modules
 import abc
 from distutils.version import LooseVersion

diff  --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 3491370fd0aaa1..506c213639e092 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -4,9 +4,6 @@
 They can also be useful for general purpose lldb scripting.
 """
 
-from __future__ import print_function
-from __future__ import absolute_import
-
 # System modules
 import errno
 import io

diff  --git a/lldb/packages/Python/lldbsuite/test/test_categories.py b/lldb/packages/Python/lldbsuite/test/test_categories.py
index c5a624c925bd9c..3883c4de5e1995 100644
--- a/lldb/packages/Python/lldbsuite/test/test_categories.py
+++ b/lldb/packages/Python/lldbsuite/test/test_categories.py
@@ -2,9 +2,6 @@
 Provides definitions for various lldb test categories
 """
 
-from __future__ import absolute_import
-from __future__ import print_function
-
 # System modules
 import sys
 

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 93e21d049d6282..3341b6e54a3bc7 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -2,9 +2,6 @@
 Base class for gdb-remote test cases.
 """
 
-from __future__ import division, print_function
-
-
 import errno
 import os
 import os.path

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
index ba6e24cdaad4e5..61c5c3a7c865a2 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
@@ -1,8 +1,6 @@
 """Module for supporting unit testing of the lldb-server debug monitor exe.
 """
 
-from __future__ import division, print_function
-
 import binascii
 import os
 import os.path

diff  --git a/lldb/scripts/android/host_art_bt.py b/lldb/scripts/android/host_art_bt.py
index b4e9d7e3027d20..03797074aafddd 100644
--- a/lldb/scripts/android/host_art_bt.py
+++ b/lldb/scripts/android/host_art_bt.py
@@ -5,8 +5,6 @@
 #   'command script import host_art_bt.py'
 #   'host_art_bt'
 
-from __future__ import print_function
-
 import sys
 import re
 

diff  --git a/lldb/third_party/Python/module/progress/progress.py b/lldb/third_party/Python/module/progress/progress.py
index 833d1a3fc3f28c..f844b9800c0192 100644
--- a/lldb/third_party/Python/module/progress/progress.py
+++ b/lldb/third_party/Python/module/progress/progress.py
@@ -1,7 +1,5 @@
 #!/usr/bin/env python
 
-from __future__ import print_function
-
 import use_lldb_suite
 
 import sys

diff  --git a/lldb/third_party/Python/module/unittest2/unittest2/test/test_result.py b/lldb/third_party/Python/module/unittest2/unittest2/test/test_result.py
index e4e26bd51feb01..9b64e8259558d2 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/test/test_result.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/test/test_result.py
@@ -1,5 +1,3 @@
-from __future__ import print_function
-
 import sys
 import textwrap
 from StringIO import StringIO

diff  --git a/lldb/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py b/lldb/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py
index 6ebf6ce9c04f2a..7544757ecc2aea 100644
--- a/lldb/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py
+++ b/lldb/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
 import unittest2
 from unittest2.test.support import OldTestResult, catch_warnings
 

diff  --git a/lldb/tools/intel-features/intel-mpx/test/TestMPXTable.py b/lldb/tools/intel-features/intel-mpx/test/TestMPXTable.py
index ab9c9f8c6c5138..a35829cd9421fa 100644
--- a/lldb/tools/intel-features/intel-mpx/test/TestMPXTable.py
+++ b/lldb/tools/intel-features/intel-mpx/test/TestMPXTable.py
@@ -2,9 +2,6 @@
 Test mpx-table command.
 """
 
-from __future__ import print_function
-
-
 import os
 import time
 import re

diff  --git a/lldb/utils/lui/lldbutil.py b/lldb/utils/lui/lldbutil.py
index 6bfaaecab4bd8f..2bf5e8ac0ef054 100644
--- a/lldb/utils/lui/lldbutil.py
+++ b/lldb/utils/lui/lldbutil.py
@@ -12,8 +12,6 @@
 They can also be useful for general purpose lldb scripting.
 """
 
-from __future__ import print_function
-
 import lldb
 import os
 import sys


        


More information about the lldb-commits mailing list