summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorDominic Socular <BBH@awsl.rip>2022-12-21 13:25:04 (GMT)
committerGitHub <noreply@github.com>2022-12-21 13:25:04 (GMT)
commit12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2 (patch)
tree99ec8bf66de6c7519d2993e5e2f66e13b917a7c8 /Lib/socket.py
parenta7715ccfba5b86ab09f86ec56ac3755c93b46b48 (diff)
downloadcpython-12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2.zip
cpython-12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2.tar.gz
cpython-12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2.tar.bz2
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
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)