From 14c5d1921c14b8aaced71e7747852c6149a18819 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Sun, 10 Dec 2023 11:47:46 +0000 Subject: [PATCH] Fix some socket constant usage --- python/ola/PidStore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/ola/PidStore.py b/python/ola/PidStore.py index f9f62121c..f48db9656 100644 --- a/python/ola/PidStore.py +++ b/python/ola/PidStore.py @@ -556,7 +556,7 @@ def __init__(self, name, **kwargs): def Unpack(self, data): try: - return socket.inet_ntop(AF_INET6, data) + return socket.inet_ntop(socket.AF_INET6, data) except socket.error as e: raise ArgsValidationError("Can't unpack data: %s" % e) @@ -565,7 +565,8 @@ def Pack(self, args): # inet_pton, we may want to restrict that in future format_string = self._FormatString() try: - data = struct.pack(format_string, socket.inet_pton(AF_INET6, args[0])) + data = struct.pack(format_string, + socket.inet_pton(socket.AF_INET6, args[0])) except socket.error as e: raise ArgsValidationError("Can't pack data: %s" % e) return data, 1