Skip to content

Commit a4e25e2

Browse files
committed
build: fix eager patch newline escaping
1 parent d576410 commit a4e25e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/patch_tfjava.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def patch_build_sh(path: Path) -> None:
344344
rule_start = text.find(rule_name)
345345
if rule_start == -1:
346346
raise SystemExit(f"tensor_handle_data rule not found in {path}")
347-
rule_end = text.find('\n)\n', rule_start)
347+
rule_end = text.find('\\n)\\n', rule_start)
348348
if rule_end == -1:
349349
raise SystemExit(f"tensor_handle_data rule end not found in {path}")
350350
rule_end += 3
@@ -373,7 +373,7 @@ def patch_build_sh(path: Path) -> None:
373373
374374
path = Path(os.environ["TENSOR_HANDLE_DATA_CC"])
375375
text = path.read_text(encoding="utf-8")
376-
text = text.replace('#include "tensorflow/core/profiler/lib/traceme.h"\n', '', 1)
376+
text = text.replace('#include "tensorflow/core/profiler/lib/traceme.h"\\n', '', 1)
377377
old = ''' profiler::TraceMe activity(
378378
[caller] { return absl::StrCat(caller, " WaitReady"); },
379379

0 commit comments

Comments
 (0)