Change assert to check for bytearray stream rather than file handle.
parent
5b38b64c97
commit
d8351e52e9
5
gnupg.py
5
gnupg.py
|
@ -61,6 +61,7 @@ import locale
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
from io import BytesIO
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
|
||||||
|
@ -102,8 +103,8 @@ def _copy_data(instream, outstream):
|
||||||
sent = 0
|
sent = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
assert isinstance(instream, file), "instream is not a file"
|
assert isinstance(instream, BytesIO), "instream is not a file"
|
||||||
assert isinstance(outsteam, file), "outstream is not a file"
|
assert isinstance(outstream, file), "outstream is not a file"
|
||||||
except AssertionError as ae:
|
except AssertionError as ae:
|
||||||
logger.exception(ae)
|
logger.exception(ae)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue