Skip to content

Commit

Permalink
Merge pull request #341 from dzimine/DZ/fix_bug
Browse files Browse the repository at this point in the history
Fix exception thrown by BinaryPayloadDecoder
  • Loading branch information
dhoomakethu authored Sep 26, 2018
2 parents 319f82a + ea82a78 commit 866bb19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymodbus/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _unpack_words(self, fstring, handle):
:return:
"""
handle = make_byte_string(handle)
wc = WC.get(fstring.lower())//2
wc = WC.get(fstring.lower()) // 2
up = "!{}H".format(wc)
handle = unpack(up, handle)
if self._wordorder == Endian.Little:
Expand All @@ -340,8 +340,8 @@ def _unpack_words(self, fstring, handle):
# Repack as unsigned Integer
pk = self._byteorder + 'H'
handle = [pack(pk, p) for p in handle]
_logger.debug(handle)
handle = b''.join(handle)
_logger.debug(unicode_string(handle))
return handle

def reset(self):
Expand Down

0 comments on commit 866bb19

Please sign in to comment.