summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2014-03-07 13:16:47 -0800
committerJeff Forcier <jeff@bitprophet.org>2014-03-07 13:16:47 -0800
commit85e9405f8a3771942d414e05b88692cd47530e60 (patch)
tree7c70d842a180bfe0f175bf9d8f84b2fe6e24b2f4
parentc646e7283225443d92712c3d559304b56085198f (diff)
Make `byte_ord` gentler
-rw-r--r--paramiko/py3compat.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/paramiko/py3compat.py b/paramiko/py3compat.py
index 22285992..8842b988 100644
--- a/paramiko/py3compat.py
+++ b/paramiko/py3compat.py
@@ -113,7 +113,9 @@ else:
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):