Update patcher.py

Fix Error: 
TypeError: '<=' not supported between instances of 'str' and 'int'
This commit is contained in:
Chris7X 2023-09-12 17:42:28 +02:00 committed by GitHub
parent cea80717c5
commit c8154b31e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -62,7 +62,17 @@ class Patcher(object):
prefix = "undetected" prefix = "undetected"
self.user_multi_procs = user_multi_procs self.user_multi_procs = user_multi_procs
self.is_old_chromedriver = version_main and version_main <= 114 try:
# Try to convert version_main into an integer
version_main_int = int(version_main)
# check if version_main_int is less than or equal to e.g 114
self.is_old_chromedriver = version_main and version_main_int <= 114
except ValueError:
# If the conversion fails, print an error message
print("version_main cannot be converted to an integer")
# Set self.is_old_chromedriver to False if the conversion fails
self.is_old_chromedriver = False
# Needs to be called before self.exe_name is accessed # Needs to be called before self.exe_name is accessed
self._set_platform_name() self._set_platform_name()