Skip to content

Commit

Permalink
style: Fix replace-stdout-stderr (UP022) (#4000)
Browse files Browse the repository at this point in the history
Using `ruff check --output-format=concise --preview --select UP022 --unsafe-fixes --fix`
  • Loading branch information
echoix authored Jul 8, 2024
1 parent cd64472 commit e952443
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ ignore = [
"TRY302", # useless-try-except
"UP015", # redundant-open-modes
"UP018", # native-literals
"UP022", # replace-stdout-stderr
"UP030", # format-literals
"UP031", # printf-string-formatting
"UP032", # f-string
Expand Down
3 changes: 1 addition & 2 deletions python/grass/gunittest/invoker.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ def _run_test_module(self, module, results_dir, gisdbase, location, timeout):
args,
cwd=cwd,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
timeout=timeout,
check=False,
)
Expand Down
3 changes: 1 addition & 2 deletions utils/generate_last_commit_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def get_last_commit(src_dir):
f"--format=%H,{COMMIT_DATE_FORMAT}",
rel_path,
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
) # --format=%H,COMMIT_DATE_FORMAT commit hash,author date
if process_result.returncode == 0:
try:
Expand Down
3 changes: 1 addition & 2 deletions utils/mkhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ def has_src_code_git(src_dir, is_addon):
f"--format=%H,{COMMIT_DATE_FORMAT}",
src_dir,
],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
capture_output=True,
) # --format=%H,COMMIT_DATE_FORMAT commit hash,author date
os.chdir(actual_dir)
return process_result if process_result.returncode == 0 else None
Expand Down
3 changes: 1 addition & 2 deletions utils/test_generate_last_commit_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def test_compare_json_file_data(read_json_file, core_module_path):
f"--format=%H,{COMMIT_DATE_FORMAT}",
core_module_path,
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=True,
) # --format=%H,COMMIT_DATE_FORMAT commit hash,author date
commit, date = process_result.stdout.decode().strip().split(",")
Expand Down

0 comments on commit e952443

Please sign in to comment.