diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-01-25 09:20:27 +0100 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-01-25 09:20:27 +0100 |
commit | 59f2ef5a64668dc7a2dc00d033b8d6e52239819a (patch) | |
tree | 6884080b290904cf0713be0ac1a5399f4113e537 | |
parent | 5650aaaa370d406afbc1656652988464042ef403 (diff) | |
download | rsa-git-59f2ef5a64668dc7a2dc00d033b8d6e52239819a.tar.gz |
Perform a late import of rsa.varblock to prevent DeprecationWarnings
-rw-r--r-- | rsa/pkcs1.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rsa/pkcs1.py b/rsa/pkcs1.py index 67909ba..088b9b7 100644 --- a/rsa/pkcs1.py +++ b/rsa/pkcs1.py @@ -32,7 +32,7 @@ import hashlib import os from rsa._compat import b -from rsa import common, transform, core, varblock +from rsa import common, transform, core # ASN.1 codes that describe the hash algorithm used. HASH_ASN1 = { @@ -335,6 +335,9 @@ def _hash(message, method_name): hasher = method() if hasattr(message, 'read') and hasattr(message.read, '__call__'): + # Late import to prevent DeprecationWarnings. + from . import varblock + # read as 1K blocks for block in varblock.yield_fixedblocks(message, 1024): hasher.update(block) |