Skip to content

Commit

Permalink
don't mutate the global 'ignored exceptions', take a copy of the glob…
Browse files Browse the repository at this point in the history
…ally specified ones, change the global to be a tuple instead

Fixes Issue #7725
  • Loading branch information
lukeis committed Sep 8, 2014
1 parent b35623b commit 1059079
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/selenium/webdriver/support/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from selenium.common.exceptions import TimeoutException

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

class WebDriverWait(object):

Expand All @@ -46,7 +46,7 @@ def __init__(self, driver, timeout, poll_frequency=POLL_FREQUENCY, ignored_excep
# avoid the divide by zero
if self._poll == 0:
self._poll = POLL_FREQUENCY
exceptions = IGNORED_EXCEPTIONS
exceptions = list(IGNORED_EXCEPTIONS)
if ignored_exceptions is not None:
try:
exceptions.extend(iter(ignored_exceptions))
Expand Down

0 comments on commit 1059079

Please sign in to comment.