Skip to content

Commit

Permalink
Make byte_ord gentler
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Mar 7, 2014
1 parent c646e72 commit 85e9405
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paramiko/py3compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def bytestring(s):
return s

def byte_ord(c):
assert isinstance(c, int)
# In case we're handed a string instead of an int.
if not isinstance(c, int):
c = ord(c)
return c

def byte_chr(c):
Expand Down

0 comments on commit 85e9405

Please sign in to comment.