mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
small fixes
This commit is contained in:
parent
951213e8ca
commit
ee3de2a8b5
2 changed files with 4 additions and 4 deletions
|
|
@ -376,7 +376,7 @@ class RawBroadcastUDPClient(RawUDPClient):
|
||||||
|
|
||||||
def connsocket(self):
|
def connsocket(self):
|
||||||
# Don't connect -- use sendto
|
# Don't connect -- use sendto
|
||||||
self.sock.allowbroadcast(1)
|
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
||||||
|
|
||||||
def set_reply_handler(self, reply_handler):
|
def set_reply_handler(self, reply_handler):
|
||||||
self.reply_handler = reply_handler
|
self.reply_handler = reply_handler
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class Packer:
|
||||||
self.pack_uint(n)
|
self.pack_uint(n)
|
||||||
self.pack_fstring(n, s)
|
self.pack_fstring(n, s)
|
||||||
|
|
||||||
pack_opaque = pack_string
|
pack_opaque = pack_fopaque
|
||||||
|
|
||||||
def pack_list(self, list, pack_item):
|
def pack_list(self, list, pack_item):
|
||||||
for item in list:
|
for item in list:
|
||||||
|
|
@ -86,7 +86,7 @@ class Packer:
|
||||||
def pack_array(self, list, pack_item):
|
def pack_array(self, list, pack_item):
|
||||||
n = len(list)
|
n = len(list)
|
||||||
self.pack_uint(n)
|
self.pack_uint(n)
|
||||||
self.pack_farray(n, list)
|
self.pack_farray(n, list, pack_item)
|
||||||
|
|
||||||
|
|
||||||
class Unpacker:
|
class Unpacker:
|
||||||
|
|
@ -176,7 +176,7 @@ class Unpacker:
|
||||||
n = self.unpack_uint()
|
n = self.unpack_uint()
|
||||||
return self.unpack_fstring(n)
|
return self.unpack_fstring(n)
|
||||||
|
|
||||||
unpack_opaque = unpack_string
|
unpack_opaque = unpack_fopaque
|
||||||
|
|
||||||
def unpack_list(self, unpack_item):
|
def unpack_list(self, unpack_item):
|
||||||
list = []
|
list = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue