summaryrefslogtreecommitdiff
path: root/rsa/pkcs1.py
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2016-01-25 09:20:27 +0100
committerSybren A. Stüvel <sybren@stuvel.eu>2016-01-25 09:20:27 +0100
commit59f2ef5a64668dc7a2dc00d033b8d6e52239819a (patch)
tree6884080b290904cf0713be0ac1a5399f4113e537 /rsa/pkcs1.py
parent5650aaaa370d406afbc1656652988464042ef403 (diff)
downloadrsa-git-59f2ef5a64668dc7a2dc00d033b8d6e52239819a.tar.gz
Perform a late import of rsa.varblock to prevent DeprecationWarnings
Diffstat (limited to 'rsa/pkcs1.py')
-rw-r--r--rsa/pkcs1.py5
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)