Skip to content

Commit

Permalink
Fixed TMATS instantiation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcferrill committed Jun 15, 2021
1 parent b6580ef commit 92ed7d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chapter10/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(self, *args, **kwargs):
packet.Packet.__init__(self, *args, **kwargs)
if self.buffer:
self.data = self.buffer.read(self.data_length - 4)
elif not self.data:
self.data = bytes()
elif not getattr(self, 'data', None):
self.data = kwargs.get('data', bytes())

def _raw_body(self):
csdw = self.csdw_format.pack(self.__dict__)
Expand Down

0 comments on commit 92ed7d2

Please sign in to comment.