Commit b8ee52f6 authored by Aurel's avatar Aurel

do not fail to return length if body is None


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@312 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 0e5254e8
......@@ -276,7 +276,10 @@ class Packet(object):
return self._type
def __len__(self):
return PACKET_HEADER_SIZE + len(self._body)
try:
return PACKET_HEADER_SIZE + len(self._body)
except TypeError:
return PACKET_HEADER_SIZE
# Encoders.
def encode(self):
......
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