Skip to content

Commit

Permalink
Give precedence to argument over environment variable
Browse files Browse the repository at this point in the history
Co-authored-by: Mads R. B. Kristensen <madsbk@gmail.com>
  • Loading branch information
pentschev and madsbk authored Jan 21, 2025
1 parent 0b02e8b commit 9f69471
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ucp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,10 @@ def __init__(
else:
self.blocking_progress_mode = True

if "UCXPY_CONNECT_TIMEOUT" in os.environ:
self.connect_timeout = float(os.environ["UCXPY_CONNECT_TIMEOUT"])
elif connect_timeout is not None:
self.connect_timeout = connect_timeout
if connect_timeout is None:
self.connect_timeout = float(os.get("UCXPY_CONNECT_TIMEOUT", 5))
else:
self.connect_timeout = 5.0

self.connect_timeout = connect_timeout
if self.blocking_progress_mode:
self.epoll_fd = self.worker.init_blocking_progress_mode()
weakref.finalize(
Expand Down

0 comments on commit 9f69471

Please sign in to comment.