fix(python-sdk): remove dead code in ConnectionConfig.__init__
Problem
In ConnectionConfig.__init__, _get_request_timeout is called and its
result assigned to self.request_timeout, but that assignment is
immediately overwritten by an inline if/elif/else block that duplicates
the same logic:
# lines 102-105 — result is never used
self.request_timeout = ConnectionConfig._get_request_timeout(
REQUEST_TIMEOUT,
request_timeout,
)
# lines 107-112 — always overwrites the above
if request_timeout == 0:
self.request_timeout = None
elif request_timeout is not None:
self.request_timeout = request_timeout
else:
self.request_timeout = REQUEST_TIMEOUT
_get_request_timeout already implements all three cases identically, so
lines 107–112 are unreachable dead code. This creates a misleading
impression that the static method is checked before the inline fallback,
and silently breaks if someone later changes _get_request_timeout
without noticing the duplicate.
Fix
Remove the inline if/elif/else block and rely solely on
_get_request_timeout, which is already the method used by
get_request_timeout for per-call overrides.
Tests
Added six unit tests to tests/test_connection_config.py covering:
- default timeout (60 s)
- explicit timeout value
0→None(no limit)get_request_timeout()with no argument inherits configured defaultget_request_timeout(override)returns the overrideget_request_timeout(0)returnsNoneregardless of config
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Ishaan Samantray. This is most likely caused by a git client misconfiguration; please make sure to:
- check if your git client is configured with an email to sign commits
git config --list | grep email - If not, set it up using
git config --global user.email [email protected] - Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
🦋 Changeset detected
Latest commit: 79232f61d680f094ca5e6e354739adb38f566427
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @e2b/python-sdk | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
hey @devteamaegis looks good! could you please sign the CLA?
would like to proceed with merge
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Ishaan Samantray. This is most likely caused by a git client misconfiguration; please make sure to:
- check if your git client is configured with an email to sign commits
git config --list | grep email - If not, set it up using
git config --global user.email [email protected] - Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
@devteamaegis reminder to sign CLA!
CLA not signed, closing stale PR.