From 5e6f209bd16235e1b9723d0ffc2abd31b61213a9 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Sun, 11 Oct 2026 08:01:18 +0000 Subject: [PATCH 1/2] refactor: optimize MRO iteration in WebDriver._add_commands --- appium/webdriver/webdriver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appium/webdriver/webdriver.py b/appium/webdriver/webdriver.py index 09d17094..52c5fd3a 100644 --- a/appium/webdriver/webdriver.py +++ b/appium/webdriver/webdriver.py @@ -467,8 +467,8 @@ def _add_commands(self) -> None: # call the overridden command binders from all mixin classes except for # appium.webdriver.webdriver.WebDriver and its sub-classes # https://github.com/appium/python-client/issues/342 - for mixin_class in filter(lambda x: not issubclass(x, WebDriver), self.__class__.__mro__): - if hasattr(mixin_class, self._add_commands.__name__): + for mixin_class in self.__class__.__mro__: + if not issubclass(mixin_class, WebDriver) and hasattr(mixin_class, self._add_commands.__name__): get_atter = getattr(mixin_class, self._add_commands.__name__, None) if get_atter: get_atter(self) From d3815e75cab9558f355e2b99b18172ab7a283b36 Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Sun, 11 Oct 2026 08:52:31 +0000 Subject: [PATCH 2/2] refactor: optimize MRO iteration in WebDriver._add_commands