Skip to content

Commit 5ec7328

Browse files
author
Konstantin Podshumok
committed
allow call of command.generate twice (may be useful for debugging)
1 parent 8b415b6 commit 5ec7328

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

smpplib/command.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,8 @@ class BindTransmitterResp(Command):
475475

476476
def __init__(self, command, **kwargs):
477477
"""Initialize"""
478-
super(BindTransmitterResp, self).__init__(command, need_sequence=False, **kwargs)
478+
super(BindTransmitterResp, self).__init__(command, need_sequence=False,
479+
**kwargs)
479480

480481
self._set_vars(**(dict.fromkeys(self.params)))
481482

@@ -754,7 +755,8 @@ def prep(self):
754755

755756
if self.short_message:
756757
self.sm_length = len(self.short_message)
757-
delattr(self, 'message_payload')
758+
if hasattr(self, 'message_payload'):
759+
delattr(self, 'message_payload')
758760
else:
759761
self.sm_length = 0
760762

@@ -770,7 +772,8 @@ class SubmitSMResp(Command):
770772

771773
def __init__(self, command, **kwargs):
772774
"""Initialize"""
773-
super(SubmitSMResp, self).__init__(command, need_sequence=False, **kwargs)
775+
super(SubmitSMResp, self).__init__(command, need_sequence=False,
776+
**kwargs)
774777
self._set_vars(**(dict.fromkeys(self.params)))
775778

776779

0 commit comments

Comments
 (0)