Skip to content

Commit 1059079

Browse files
committed
don't mutate the global 'ignored exceptions', take a copy of the globally specified ones, change the global to be a tuple instead
Fixes Issue #7725
1 parent b35623b commit 1059079

File tree

1 file changed

+2
-2
lines changed
  • py/selenium/webdriver/support

1 file changed

+2
-2
lines changed

py/selenium/webdriver/support/wait.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from selenium.common.exceptions import TimeoutException
2020

2121
POLL_FREQUENCY = 0.5 # How long to sleep inbetween calls to the method
22-
IGNORED_EXCEPTIONS = [NoSuchElementException] # list of exceptions ignored during calls to the method
22+
IGNORED_EXCEPTIONS = (NoSuchElementException,) # exceptions ignored during calls to the method
2323

2424
class WebDriverWait(object):
2525

@@ -46,7 +46,7 @@ def __init__(self, driver, timeout, poll_frequency=POLL_FREQUENCY, ignored_excep
4646
# avoid the divide by zero
4747
if self._poll == 0:
4848
self._poll = POLL_FREQUENCY
49-
exceptions = IGNORED_EXCEPTIONS
49+
exceptions = list(IGNORED_EXCEPTIONS)
5050
if ignored_exceptions is not None:
5151
try:
5252
exceptions.extend(iter(ignored_exceptions))

0 commit comments

Comments
 (0)