From ca5fe635b9894cd8f657c0c6023a24900b0d4d71 Mon Sep 17 00:00:00 2001 From: UltrafunkAmsterdam Date: Fri, 10 Feb 2023 19:19:10 +0100 Subject: [PATCH] patch referenced before assignment --- undetected_chromedriver/patcher.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/undetected_chromedriver/patcher.py b/undetected_chromedriver/patcher.py index 1f6b5bd..24da802 100644 --- a/undetected_chromedriver/patcher.py +++ b/undetected_chromedriver/patcher.py @@ -225,16 +225,16 @@ class Patcher(object): len(target_bytes), b" " ) ) - new_content = content.replace(target_bytes, new_target_bytes) - if new_content == content: - logger.warning( - "something went wrong patching the driver binary. could not find injection code block" - ) - else: - logger.debug( - "found block:\n%s\nreplacing with:\n%s" - % (target_bytes, new_target_bytes) - ) + new_content = content.replace(target_bytes, new_target_bytes) + if new_content == content: + logger.warning( + "something went wrong patching the driver binary. could not find injection code block" + ) + else: + logger.debug( + "found block:\n%s\nreplacing with:\n%s" + % (target_bytes, new_target_bytes) + ) fh.seek(0) fh.write(new_content) logger.debug(