diff --git a/psutil/__init__.py b/psutil/__init__.py index e1e2b7d5d..30f45987e 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -1601,14 +1601,14 @@ def check_gone(proc, timeout): check_gone(proc, timeout) else: check_gone(proc, max_timeout) - alive = alive - gone + alive = alive - gone # noqa PLR6104 if alive: # Last attempt over processes survived so far. # timeout == 0 won't make this function wait any further. for proc in alive: check_gone(proc, 0) - alive = alive - gone + alive = alive - gone # noqa: PLR6104 return (list(gone), list(alive)) diff --git a/pyproject.toml b/pyproject.toml index 94266a7bf..6f5bab2da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,10 +46,13 @@ ignore = [ "FIX", # Line contains TODO / XXX / ..., consider resolving the issue "FLY", # flynt (PYTHON2.7 COMPAT) "FURB101", # `open` and `read` should be replaced by `Path(src).read_text()` + "FURB103", # `open` and `write` should be replaced by `Path(...).write_text(...)` "FURB113", # Use `x.extend(('a', 'b', 'c'))` instead of repeatedly calling `x.append()` + "FURB116", # [*] Replace `hex` call with `f"{start:x}"` "FURB118", # [*] Use `operator.add` instead of defining a lambda "FURB140", # [*] Use `itertools.starmap` instead of the generator "FURB145", # [*] Prefer `copy` method over slicing (PYTHON2.7 COMPAT) + "FURB192", # [*] Prefer `min` over `sorted()` to compute the minimum value in a sequence "INP", # flake8-no-pep420 "N801", # Class name `async_chat` should use CapWords convention (ASYNCORE COMPAT) "N802", # Function name X should be lowercase. @@ -108,7 +111,7 @@ ignore = [ "psutil/tests/*" = ["EM101", "TRY003"] "psutil/tests/runner.py" = ["T201", "T203"] "scripts/*" = ["T201", "T203"] -"scripts/internal/*" = ["T201", "T203"] +"scripts/internal/*" = ["EM101", "T201", "T203", "TRY003"] "setup.py" = ["T201", "T203"] [tool.ruff.lint.isort] diff --git a/scripts/internal/print_announce.py b/scripts/internal/print_announce.py index 68201d7fc..d1a7d297f 100755 --- a/scripts/internal/print_announce.py +++ b/scripts/internal/print_announce.py @@ -86,13 +86,15 @@ def get_changes(): block = [] # eliminate the part preceding the first block - for line in lines: + while lines: line = lines.pop(0) if line.startswith('===='): break - lines.pop(0) + else: + raise ValueError("something wrong") - for line in lines: + lines.pop(0) + while lines: line = lines.pop(0) line = line.rstrip() if re.match(r"^- \d+_", line): @@ -101,6 +103,8 @@ def get_changes(): if line.startswith('===='): break block.append(line) + else: + raise ValueError("something wrong") # eliminate bottom empty lines block.pop(-1)