Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #183 from laserson/compat
Browse files Browse the repository at this point in the history
fix set_timeout backwards compatibility
  • Loading branch information
lxyu committed Feb 5, 2016
2 parents 6b342c7 + 4db14a7 commit 010717e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions thriftpy/transport/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ def set_timeout(self, ms):
"""Backward compat api, will bind the timeout to both connect_timeout
and socket_timeout.
"""
if ms and ms > 0:
self.socket_timeout = ms / 1000
self.connect_timeout = self.socket_timeout
self.socket_timeout = ms / 1000 if (ms and ms > 0) else None
self.connect_timeout = self.socket_timeout

def is_open(self):
return bool(self.sock)
Expand Down

0 comments on commit 010717e

Please sign in to comment.