Skip to content

Commit

Permalink
Fix some socket constant usage
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman committed Dec 10, 2023
1 parent ad9aea5 commit 14c5d19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/ola/PidStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 14c5d19

Please sign in to comment.