diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2018-01-10 08:17:09 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2018-01-10 08:17:09 -0500 |
commit | d2c12683d3ddf454f99673ad7878673b60998b3e (patch) | |
tree | 81db84338c9671db93fcedf9a00a818081ca5f13 /src | |
parent | 038146fdc7a515937398f226531ef15d2674b3b9 (diff) | |
download | cryptography-d2c12683d3ddf454f99673ad7878673b60998b3e.tar.gz cryptography-d2c12683d3ddf454f99673ad7878673b60998b3e.tar.bz2 cryptography-d2c12683d3ddf454f99673ad7878673b60998b3e.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/utils.py | 3 |
1 files changed, 1 insertions, 2 deletions
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"): |