Skip to content

Commit

Permalink
patch_py
Browse files Browse the repository at this point in the history
  • Loading branch information
John-LittleBearLabs committed Oct 29, 2024
1 parent 4cc4d23 commit 6528b95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmake/inc_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from glob import glob
import os
from os import listdir, readlink, set_blocking, symlink
from os.path import dirname, exists, isdir, isfile, islink, join, relpath, splitext
from subprocess import DEVNULL, Popen, PIPE, TimeoutExpired
from sys import executable, stderr
from os.path import dirname, exists, isdir, isfile, islink, join, splitext
from subprocess import DEVNULL, Popen, PIPE
from sys import stderr

import json

Expand Down
9 changes: 5 additions & 4 deletions cmake/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
)
from shutil import copyfile, rmtree
from subprocess import call, CalledProcessError, check_call, check_output, DEVNULL
from sys import argv, executable, exit, platform, stderr
import sys
from sys import argv, executable, platform, stderr
from time import ctime, time
from verbose import verbose

Expand Down Expand Up @@ -66,7 +67,7 @@ def content_differs(ap, bp):
return a.read() != b.read()
except Exception as e:
print(f"Error diffing {ap} against {bp}: {e}", file=stderr)
exit(7)
sys.exit(7)


class Result(Enum):
Expand Down Expand Up @@ -227,7 +228,7 @@ def check_patch(self, patch_path: str, relative: str, target_path: str):
") with",
patch_path,
)
exit(8)
sys.exit(8)

def git(self, args: list[str], result: Result) -> str:
a = [self.gbin, "-C", self.csrc] + args
Expand Down Expand Up @@ -577,7 +578,7 @@ def list_ood(self, to_check: list[str], sense: bool, both: bool = False):
end = len(line) - len(SUFFIX) - 1
pch = line[len(PREFIX): end]
if pr.out_of_date(pch):
exit(9)
sys.exit(9)
else:
pr.git(["add", line[3:]], Result.OrDie)
else:
Expand Down

0 comments on commit 6528b95

Please sign in to comment.