From d8351e52e90f5e946e2a0a4b889b93d61faee8a4 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 2 Apr 2013 05:38:32 +0000 Subject: [PATCH] Change assert to check for bytearray stream rather than file handle. --- gnupg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnupg.py b/gnupg.py index 5c53c8a..846726c 100644 --- a/gnupg.py +++ b/gnupg.py @@ -61,6 +61,7 @@ import locale try: from io import StringIO + from io import BytesIO except ImportError: from cStringIO import StringIO @@ -102,8 +103,8 @@ def _copy_data(instream, outstream): sent = 0 try: - assert isinstance(instream, file), "instream is not a file" - assert isinstance(outsteam, file), "outstream is not a file" + assert isinstance(instream, BytesIO), "instream is not a file" + assert isinstance(outstream, file), "outstream is not a file" except AssertionError as ae: logger.exception(ae) return