Fix test for socket.getfqdn() to also include the name returned by

socket.gethostname() in the check for a valid return.

Also clarified docs (official and docstring) that the value from gethostname()
is returned if gethostbyaddr() doesn't do the job.
This commit is contained in:
Brett Cannon 2005-03-11 00:04:17 +00:00
parent 94d6201eb0
commit 01668a1ab9
3 changed files with 4 additions and 4 deletions

View file

@ -102,7 +102,7 @@ def getfqdn(name=''):
First the hostname returned by gethostbyaddr() is checked, then
possibly existing aliases. In case no FQDN is available, hostname
is returned.
from gethostname() is returned.
"""
name = name.strip()
if not name or name == '0.0.0.0':