Commit bcf4afa0 authored by Julien Muchembled's avatar Julien Muchembled

Drop ability to build packets with keyword arguments

The removed tests only covered this.
parent 0e06d906
...@@ -236,14 +236,10 @@ class Packet(object): ...@@ -236,14 +236,10 @@ class Packet(object):
_id = None _id = None
poll_thread = False poll_thread = False
def __init__(self, *args, **kw): def __init__(self, *args):
assert self._code is not None, "Packet class not registered" assert self._code is not None, "Packet class not registered"
if args or kw: if args:
args = list(args)
buf = StringIO() buf = StringIO()
# load named arguments
for item in self._fmt._items[len(args):]:
args.append(kw.get(item._name))
self._fmt.encode(buf.write, args) self._fmt.encode(buf.write, args)
self._body = buf.getvalue() self._body = buf.getvalue()
else: else:
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment