Skip to content

Commit a3da6b5

Browse files
committed
Fix: Timeout env variable GLOBAL_DEFAULT_TIMEOUT has no effect
1 parent f457f15 commit a3da6b5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

py/selenium/webdriver/remote/client_config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,9 @@ def __init__(
105105
self.extra_headers = extra_headers
106106

107107
self.timeout = (
108-
(
109-
float(os.getenv("GLOBAL_DEFAULT_TIMEOUT", str(socket.getdefaulttimeout())))
110-
if os.getenv("GLOBAL_DEFAULT_TIMEOUT") is not None
111-
else socket.getdefaulttimeout()
112-
)
113-
if timeout is None
114-
else timeout
108+
float(os.getenv("GLOBAL_DEFAULT_TIMEOUT"))
109+
if os.getenv("GLOBAL_DEFAULT_TIMEOUT") is not None
110+
else (timeout if timeout is not None else socket.getdefaulttimeout())
115111
)
116112

117113
self.ca_certs = (
@@ -122,7 +118,11 @@ def __init__(
122118

123119
def reset_timeout(self) -> None:
124120
"""Resets the timeout to the default value of socket."""
125-
self._timeout = socket.getdefaulttimeout()
121+
self._timeout = (
122+
float(os.getenv("GLOBAL_DEFAULT_TIMEOUT"))
123+
if os.getenv("GLOBAL_DEFAULT_TIMEOUT") is not None
124+
else socket.getdefaulttimeout()
125+
)
126126

127127
def get_proxy_url(self) -> Optional[str]:
128128
"""Returns the proxy URL to use for the connection."""

0 commit comments

Comments
 (0)