From d2c12683d3ddf454f99673ad7878673b60998b3e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 10 Jan 2018 08:17:09 -0500 Subject: Fixes #4076 - simplify the implementation of int_from_bytes on python2 (#4077) * Fixes #4076 - simplify the implementation of int_from_bytes on python2 * whitespace * Added a test --- src/cryptography/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py index d69ed89f..14909c66 100644 --- a/src/cryptography/utils.py +++ b/src/cryptography/utils.py @@ -57,8 +57,7 @@ else: assert byteorder == 'big' assert not signed - # call bytes() on data to allow the use of bytearrays - return int(bytes(data).encode('hex'), 16) + return int(binascii.hexlify(data), 16) if hasattr(int, "to_bytes"): -- cgit v1.2.3