summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 1c8cef6..3a4f94d 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -785,11 +785,11 @@ def getfqdn(name=''):
First the hostname returned by gethostbyaddr() is checked, then
possibly existing aliases. In case no FQDN is available and `name`
- was given, it is returned unchanged. If `name` was empty or '0.0.0.0',
+ was given, it is returned unchanged. If `name` was empty, '0.0.0.0' or '::',
hostname from gethostname() is returned.
"""
name = name.strip()
- if not name or name == '0.0.0.0':
+ if not name or name in ('0.0.0.0', '::'):
name = gethostname()
try:
hostname, aliases, ipaddrs = gethostbyaddr(name)