From 9350168a1eed3f055040d7cc8a9bf4cdf745b23a Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 17 Feb 2017 12:10:34 +0100 Subject: python: Fix using strings as commands in the assuan protocol. * lang/python/gpg/core.py (Context.assuan_transact): Fix testing whether the command is a string on Python2. * lang/python/tests/t-protocol-assuan.py: Improve the test to detect this problem. Signed-off-by: Justus Winter --- lang/python/tests/t-protocol-assuan.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lang/python/tests/t-protocol-assuan.py') diff --git a/lang/python/tests/t-protocol-assuan.py b/lang/python/tests/t-protocol-assuan.py index 0084a6bd..27b28c72 100755 --- a/lang/python/tests/t-protocol-assuan.py +++ b/lang/python/tests/t-protocol-assuan.py @@ -24,9 +24,12 @@ import gpg with gpg.Context(protocol=gpg.constants.protocol.ASSUAN) as c: # Do nothing. - c.assuan_transact('nop') - c.assuan_transact('NOP') - c.assuan_transact(['NOP']) + err = c.assuan_transact('nop') + assert err == None + err = c.assuan_transact(b'NOP') + assert err == None + err = c.assuan_transact(['NOP']) + assert err == None err = c.assuan_transact('idontexist') assert err.getsource() == gpg.errors.SOURCE_GPGAGENT -- cgit v1.2.3