Skip to content

Commit

Permalink
Fix timeout bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ptr-yudai committed May 23, 2024
1 parent adcb3e1 commit e116d64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions ptrlib/connection/tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __new__(cls, *args, **kwargs):
# Constructor
#
def __init__(self,
timeout: Optional[Union[int, float]]=None,
timeout: Union[int, float]=0,
debug: bool=False):
"""Base constructor
Expand Down Expand Up @@ -125,8 +125,7 @@ def settimeout(self, timeout: Optional[Union[int, float]]=None):
"`timeout` must be positive and either int or float"

if timeout is None:
if self._default_timeout is not None:
self._settimeout_impl(self._default_timeout)
self._settimeout_impl(self._default_timeout)
else:
self._settimeout_impl(timeout)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='ptrlib',
version='2.3.1',
version='2.3.2',
description='CTF library',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
1 change: 0 additions & 1 deletion tests/connection/test_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,3 @@ def test_timeout(self):
with self.assertRaises(TimeoutError) as cm:
p.sendlineafter(b"neko", b, timeout=0.5)
self.assertEqual(cm.exception.args[1].decode().strip(), a)

0 comments on commit e116d64

Please sign in to comment.