mirror of
https://github.com/python/cpython.git
synced 2025-11-11 19:12:05 +00:00
gh-132390: Apply Ruff linting to Tools/build (#132391)
--------- Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
246ed23456
commit
5d8e432d9f
16 changed files with 109 additions and 99 deletions
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
See --help for more information
|
||||
"""
|
||||
import _imp
|
||||
import argparse
|
||||
import collections
|
||||
import enum
|
||||
|
|
@ -27,12 +28,14 @@
|
|||
import sys
|
||||
import sysconfig
|
||||
import warnings
|
||||
import _imp
|
||||
|
||||
from collections.abc import Iterable
|
||||
from importlib._bootstrap import _load as bootstrap_load
|
||||
from importlib.machinery import BuiltinImporter, ExtensionFileLoader, ModuleSpec
|
||||
from importlib.machinery import (
|
||||
BuiltinImporter,
|
||||
ExtensionFileLoader,
|
||||
ModuleSpec,
|
||||
)
|
||||
from importlib.util import spec_from_file_location, spec_from_loader
|
||||
from typing import Iterable
|
||||
|
||||
SRC_DIR = pathlib.Path(__file__).parent.parent.parent
|
||||
|
||||
|
|
@ -195,7 +198,7 @@ def print_three_column(modinfos: list[ModuleInfo]):
|
|||
# guarantee zip() doesn't drop anything
|
||||
while len(names) % 3:
|
||||
names.append("")
|
||||
for l, m, r in zip(names[::3], names[1::3], names[2::3]):
|
||||
for l, m, r in zip(names[::3], names[1::3], names[2::3]): # noqa: E741
|
||||
print("%-*s %-*s %-*s" % (longest, l, longest, m, longest, r))
|
||||
|
||||
if verbose and self.builtin_ok:
|
||||
|
|
@ -420,7 +423,7 @@ def check_module_import(self, modinfo: ModuleInfo):
|
|||
except ImportError as e:
|
||||
logger.error("%s failed to import: %s", modinfo.name, e)
|
||||
raise
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
if not hasattr(_imp, 'create_dynamic'):
|
||||
logger.warning("Dynamic extension '%s' ignored", modinfo.name)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue