From ea6bfea2fbe6b72b9a62fc78126f6d07e25d671d Mon Sep 17 00:00:00 2001 From: Joshua Fehler Date: Tue, 11 Jun 2024 11:49:24 -0400 Subject: [PATCH] fixup --- splinter/driver/webdriver/__init__.py | 4 ++-- splinter/driver/webdriver/keyboard.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/splinter/driver/webdriver/__init__.py b/splinter/driver/webdriver/__init__.py index 0e4f386ed..62b12a3d5 100644 --- a/splinter/driver/webdriver/__init__.py +++ b/splinter/driver/webdriver/__init__.py @@ -803,7 +803,7 @@ def press(self, key: str, delay: int = 0) -> None: for item in key_pattern: # If in selenium keys, use it, if not, assume literal. - key_value = getattr(Keys, item) + key_value = getattr(Keys, item, None) if key_value: chain = chain.key_down(key_value, self._element) @@ -815,7 +815,7 @@ def press(self, key: str, delay: int = 0) -> None: for item in key_pattern: # If in selenium keys, use it, if not, assume literal. - key_value = getattr(Keys, item) + key_value = getattr(Keys, item, None) if key_value: chain = chain.key_up(key_value, self._element) diff --git a/splinter/driver/webdriver/keyboard.py b/splinter/driver/webdriver/keyboard.py index fcaecd797..38008f396 100644 --- a/splinter/driver/webdriver/keyboard.py +++ b/splinter/driver/webdriver/keyboard.py @@ -27,7 +27,7 @@ def press(self, key: str, delay: int = 0) -> None: for item in key_pattern: # If in selenium keys, use it, if not, assume literal. - key_value = getattr(Keys, item) + key_value = getattr(Keys, item, None) if key_value: chain = chain.key_down(key_value) # , self._element) @@ -39,7 +39,7 @@ def press(self, key: str, delay: int = 0) -> None: for item in key_pattern: # If in selenium keys, use it, if not, assume literal. - key_value = getattr(Keys, item) + key_value = getattr(Keys, item, None) if key_value: chain = chain.key_up(key_value) # , self._element)