From 1802b2b8ba369abbc7f50f5d88dbf3a9fa92f1fa Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio Date: Wed, 23 Oct 2024 17:14:06 -0700 Subject: [PATCH] Move unnecessary logs in file_manager.py --- utils/file_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/file_manager.py b/utils/file_manager.py index d1ad2183..6f5cebb3 100644 --- a/utils/file_manager.py +++ b/utils/file_manager.py @@ -27,9 +27,6 @@ def apply_patch(original_text: str, diff_text: str): Assume -R? [n]: No Apply anyway? [y]: Yes """ - # Print encodings of input texts - print(f"Org text encoding: {chardet.detect(original_text.encode())['encoding']}") - print(f"Diff text encoding: {chardet.detect(diff_text.encode())['encoding']}") # Create temporary files as subprocess.run() accepts only file paths with tempfile.NamedTemporaryFile( @@ -103,6 +100,9 @@ def apply_patch(original_text: str, diff_text: str): # Log the error and return an empty string not to break the flow msg = f"Failed to apply patch partially or entirelly because something is wrong in diff. Analyze the reason from stderr and rej_text, modify the diff, and try again.\n\ndiff_text:\n{diff_text}\n\nstderr:\n{stderr}\n\nrej_text:\n{rej_text}\n" + # Print encodings of input texts + print(f"Org encoding: {chardet.detect(original_text.encode())['encoding']}") + print(f"Diff encoding: {chardet.detect(diff_text.encode())['encoding']}") print(msg, end="") # logging.error(msg) return modified_text, msg