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 )