Re: Multiple copies of timeoutsocket.py in Debian packages
Olivier Berger <olivier.berger@telecom-sudparis.eu> writes:
> I'm tempted to think that it may even no longer be needed at all,
It's only needed for Python 2.2 and earlier; it should be quite safe to
replace with the built-in equivalents on any modern version of
Python. (You may find that programs aren't using it anyway if they spot
the modern version is available; e.g. feedparser and rawdog both used to
use timeoutsocket as a fallback, and have removed this more recently
when dropping support for older Python versions.)
If you've got code that used to do:
timeoutsocket.setDefaultSocketTimeout(n) # the most common usage
somesocket.set_timeout(n)
somesocket.get_timeout()
then the modern equivalents are:
socket.setdefaulttimeout(n)
somesocket.settimeout(n)
somesocket.gettimeout()
Thanks,
--
Adam Sampson <ats@offog.org> <http://offog.org/>
Reply to: