gethostbyname blocking

Jean-Paul Calderone exarkun at divmod.com
Wed Apr 22 15:02:16 EDT 2009


On Wed, 22 Apr 2009 20:50:51 +0200, Christian Heimes <lists at cheimes.de> wrote:
>Jean-Paul Calderone wrote:
>> I'm not sure what the easiest way to determine whether Python has found
>> gethostbyname_r or not on your system is.  The configure script used to
>> build Python will probably tell, but I doubt you have that lying around.
>> You could just assume this is the case, since you're observing behavior
>> consistent with it. ;)
>
>This works on every Unix-like system:
>
>>>> import distutils.sysconfig
>>>> distutils.sysconfig.get_config_var("HAVE_GETHOSTBYNAME_R")
>1
>

Cool, I thought there was some sysconfig-related approach.  Thanks for
pointing out what it is.

Jean-Paul



More information about the Python-list mailing list