From 85e9405f8a3771942d414e05b88692cd47530e60 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 7 Mar 2014 13:16:47 -0800 Subject: [PATCH] Make `byte_ord` gentler --- paramiko/py3compat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paramiko/py3compat.py b/paramiko/py3compat.py index 2228599..8842b98 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):