[libcxx-commits] [libcxx] 0d3c40b - [libc++] Remove unused Python imports (#73724)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Nov 29 06:25:10 PST 2023
Author: Stephan T. Lavavej
Date: 2023-11-29T09:25:06-05:00
New Revision: 0d3c40b82b3b667a4f7f69f45658c184615fd54f
URL: https://github.com/llvm/llvm-project/commit/0d3c40b82b3b667a4f7f69f45658c184615fd54f
DIFF: https://github.com/llvm/llvm-project/commit/0d3c40b82b3b667a4f7f69f45658c184615fd54f.diff
LOG: [libc++] Remove unused Python imports (#73724)
VSCode's Pylance extension informed me, and text searching confirmed,
that these imports are unused. I believe we should be able to remove
them harmlessly.
Added:
Modified:
libcxx/test/libcxx/transitive_includes_to_csv.py
libcxx/utils/adb_run.py
libcxx/utils/gdb/libcxx/printers.py
libcxx/utils/generate_escaped_output_table.py
libcxx/utils/generate_extended_grapheme_cluster_table.py
libcxx/utils/generate_extended_grapheme_cluster_test.py
libcxx/utils/generate_std_clang_module_header.py
libcxx/utils/generate_std_cppm_in.py
libcxx/utils/generate_width_estimation_table.py
libcxx/utils/graph_header_deps.py
libcxx/utils/libcxx/test/android.py
libcxx/utils/libcxx/test/dsl.py
libcxx/utils/libcxx/test/format.py
libcxx/utils/qemu_baremetal.py
Removed:
################################################################################
diff --git a/libcxx/test/libcxx/transitive_includes_to_csv.py b/libcxx/test/libcxx/transitive_includes_to_csv.py
index 8ba94977a01ffaf..3ce28025112214e 100755
--- a/libcxx/test/libcxx/transitive_includes_to_csv.py
+++ b/libcxx/test/libcxx/transitive_includes_to_csv.py
@@ -7,7 +7,7 @@
#
# ===----------------------------------------------------------------------===##
-from dataclasses import dataclass, field
+from dataclasses import dataclass
from typing import List # Needed for python 3.8 compatibility.
import argparse
import pathlib
diff --git a/libcxx/utils/adb_run.py b/libcxx/utils/adb_run.py
index b54198fed44a43f..dc15b51d7f6058a 100755
--- a/libcxx/utils/adb_run.py
+++ b/libcxx/utils/adb_run.py
@@ -18,7 +18,7 @@
import socket
import subprocess
import sys
-from typing import List, Optional, Tuple
+from typing import List, Tuple
# Sync a host file /path/to/dir/file to ${REMOTE_BASE_DIR}/run-${HASH}/dir/file.
diff --git a/libcxx/utils/gdb/libcxx/printers.py b/libcxx/utils/gdb/libcxx/printers.py
index 251761ac9e1398e..3f39232ab4d3b80 100644
--- a/libcxx/utils/gdb/libcxx/printers.py
+++ b/libcxx/utils/gdb/libcxx/printers.py
@@ -12,7 +12,6 @@
from __future__ import print_function
-import math
import re
import gdb
diff --git a/libcxx/utils/generate_escaped_output_table.py b/libcxx/utils/generate_escaped_output_table.py
index 09e186ca5ac2666..8588570c133fe56 100755
--- a/libcxx/utils/generate_escaped_output_table.py
+++ b/libcxx/utils/generate_escaped_output_table.py
@@ -15,7 +15,7 @@
from io import StringIO
from pathlib import Path
-from dataclasses import dataclass, field
+from dataclasses import dataclass
from typing import Optional
import re
import sys
diff --git a/libcxx/utils/generate_extended_grapheme_cluster_table.py b/libcxx/utils/generate_extended_grapheme_cluster_table.py
index 00509981ca748fb..6f2c4f3e505faf1 100755
--- a/libcxx/utils/generate_extended_grapheme_cluster_table.py
+++ b/libcxx/utils/generate_extended_grapheme_cluster_table.py
@@ -15,7 +15,7 @@
from io import StringIO
from pathlib import Path
-from dataclasses import dataclass, field
+from dataclasses import dataclass
from typing import Optional
import re
import sys
diff --git a/libcxx/utils/generate_extended_grapheme_cluster_test.py b/libcxx/utils/generate_extended_grapheme_cluster_test.py
index 6714b221b778964..e0a6003ecd53c1c 100755
--- a/libcxx/utils/generate_extended_grapheme_cluster_test.py
+++ b/libcxx/utils/generate_extended_grapheme_cluster_test.py
@@ -16,7 +16,6 @@
from pathlib import Path
from dataclasses import dataclass, field
from typing import Optional, TextIO
-from array import array
import sys
diff --git a/libcxx/utils/generate_std_clang_module_header.py b/libcxx/utils/generate_std_clang_module_header.py
index afdc9f653c2a259..33c9acf39537960 100644
--- a/libcxx/utils/generate_std_clang_module_header.py
+++ b/libcxx/utils/generate_std_clang_module_header.py
@@ -6,7 +6,6 @@
#
# ===----------------------------------------------------------------------===##
-import operator
import os.path
import libcxx.header_information
diff --git a/libcxx/utils/generate_std_cppm_in.py b/libcxx/utils/generate_std_cppm_in.py
index 522f1dd8161aea2..242134773e6891c 100644
--- a/libcxx/utils/generate_std_cppm_in.py
+++ b/libcxx/utils/generate_std_cppm_in.py
@@ -6,7 +6,6 @@
#
# ===----------------------------------------------------------------------===##
-import operator
import os.path
from libcxx.header_information import module_headers
diff --git a/libcxx/utils/generate_width_estimation_table.py b/libcxx/utils/generate_width_estimation_table.py
index 8739cf6fe812687..76b70f121eabd7e 100644
--- a/libcxx/utils/generate_width_estimation_table.py
+++ b/libcxx/utils/generate_width_estimation_table.py
@@ -15,7 +15,7 @@
from io import StringIO
from pathlib import Path
-from dataclasses import dataclass, field
+from dataclasses import dataclass
from typing import Optional
import re
import sys
diff --git a/libcxx/utils/graph_header_deps.py b/libcxx/utils/graph_header_deps.py
index bb5889f4e97796f..6c4bd2a056d5fc8 100755
--- a/libcxx/utils/graph_header_deps.py
+++ b/libcxx/utils/graph_header_deps.py
@@ -8,7 +8,6 @@
# ===----------------------------------------------------------------------===##
import argparse
-import sys
if __name__ == "__main__":
"""Converts a header dependency CSV file to Graphviz dot file.
diff --git a/libcxx/utils/libcxx/test/android.py b/libcxx/utils/libcxx/test/android.py
index 29c681581b90d62..a40305b4dca0299 100644
--- a/libcxx/utils/libcxx/test/android.py
+++ b/libcxx/utils/libcxx/test/android.py
@@ -6,8 +6,6 @@
#
#===----------------------------------------------------------------------===##
-import atexit
-import os
import re
import select
import socket
diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py
index 5d4ca83be130856..387862ae6f496d6 100644
--- a/libcxx/utils/libcxx/test/dsl.py
+++ b/libcxx/utils/libcxx/test/dsl.py
@@ -10,9 +10,7 @@
import pickle
import pipes
import platform
-import re
import shutil
-import subprocess
import tempfile
import libcxx.test.format
diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 52c6f9cd8f2ef22..5eb17d417489c62 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -6,14 +6,10 @@
#
# ===----------------------------------------------------------------------===##
-import contextlib
-import io
import lit
import lit.formats
import os
-import pipes
import re
-import shutil
def _getTempPaths(test):
diff --git a/libcxx/utils/qemu_baremetal.py b/libcxx/utils/qemu_baremetal.py
index c509c8b4aea54cd..aaf5b84489066d7 100755
--- a/libcxx/utils/qemu_baremetal.py
+++ b/libcxx/utils/qemu_baremetal.py
@@ -15,8 +15,6 @@
import argparse
import os
-import platform
-import subprocess
import sys
More information about the libcxx-commits
mailing list