From 835ee7ed723cc3ede793a936ef98a104179d1b75 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Fri, 17 Feb 2023 18:14:31 -0500 Subject: [PATCH] Undo a bug fix that caused a worse bug. (#11666) ### Undo a bug fix that caused a worse bug. Do to https://github.com/SeleniumHQ/selenium/commit/3f6717df6407180f8fae81a85702e7eec5a81093#diff-10fa59c3fd96a0c31762373ca8d7373c0ab669a437ae957b1a17ea1377b20608 a worse bug was allowed to appear that caused deprecation warnings for everyone using ``selenium`` ``4.8.1`` with unittest / pytest. ``DeprecationWarning: keep_alive has been deprecated, please pass in a Service object``, even if not setting ``keep_alive``. This temporary fix will allow the Selenium Team more time to deal with the proper fix for both bugs. (Caused by duplicate calls in Chrome / Chromium ``__init__()`` methods. --- py/selenium/webdriver/chromium/webdriver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/selenium/webdriver/chromium/webdriver.py b/py/selenium/webdriver/chromium/webdriver.py index d171ffbce7b59..935b782f6dcc5 100644 --- a/py/selenium/webdriver/chromium/webdriver.py +++ b/py/selenium/webdriver/chromium/webdriver.py @@ -74,7 +74,7 @@ def __init__( DeprecationWarning, stacklevel=2, ) - if keep_alive != DEFAULT_KEEP_ALIVE and isinstance(self, __class__): + if keep_alive != DEFAULT_KEEP_ALIVE and type(self) == __class__: warnings.warn( "keep_alive has been deprecated, please pass in a Service object", DeprecationWarning, stacklevel=2 )