Skip to content

Commit 1ba7d10

Browse files
committed
Fix handling of check argument in run function
1 parent 52a4a50 commit 1ba7d10

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

btrup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,7 @@ def parse_suffix(name: str, prefix: str, datetime_format: str) -> datetime:
525525
return datetime.strptime(name[len(prefix) :], datetime_format)
526526

527527

528-
def run(
529-
cmd: list[str], dry_run: bool = False, check: bool = True, capture: bool = False, **kwargs
530-
) -> str:
528+
def run(cmd: list[str], dry_run: bool = False, capture: bool = False, **kwargs) -> str:
531529
"""Print and run a command."""
532530
cmd_info = " ".join(cmd)
533531
if "cwd" in kwargs:
@@ -546,7 +544,7 @@ def run(
546544
kwargs["universal_newlines"] = True
547545
if capture:
548546
kwargs["capture_output"] = True
549-
cp = subprocess.run(cmd, check=True, **kwargs)
547+
cp = subprocess.run(cmd, **kwargs) # noqa: PLW1510
550548
return cp.stdout or ""
551549

552550

0 commit comments

Comments
 (0)