Skip to content

Commit

Permalink
Bug fix: TypeError: a bytes-like object is required, not 'str'
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinhardy committed Jan 15, 2020
1 parent 8e2016b commit 88fabba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tnscmd.py
Expand Up @@ -103,9 +103,9 @@ def getVersion(self):
else:
hexVsnnum = str(hex(int(vsnnum[0])))[2:]
if len(hexVsnnum) == 7:
hexVersionList = struct.unpack('cc2sc2s',hexVsnnum)
hexVersionList = struct.unpack('cc2sc2s',hexVsnnum.encode())
elif len(hexVsnnum) == 8:
hexVersionList = struct.unpack('2sc2sc2s',hexVsnnum)
hexVersionList = struct.unpack('2sc2sc2s',hexVsnnum.encode())
for v in hexVersionList : self.version += str(int(v,16)) + '.'
return self.version

Expand Down

0 comments on commit 88fabba

Please sign in to comment.