From d30253ae61bb81090ba43b055094dbe5a6d7c98d Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 13 Aug 2013 15:06:54 +0000 Subject: QPID-4711: translate between structured content in AMQP 0-10 and 1.0 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1513537 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qpid/python/python.i | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/bindings') diff --git a/qpid/cpp/bindings/qpid/python/python.i b/qpid/cpp/bindings/qpid/python/python.i index c10ea46000..9158836a2b 100644 --- a/qpid/cpp/bindings/qpid/python/python.i +++ b/qpid/cpp/bindings/qpid/python/python.i @@ -351,6 +351,9 @@ QPID_EXCEPTION(UnauthorizedAccess, SessionError) self.setProperty(k, v) def _get_content(self) : + obj = self.getContentObject() + if obj: + return obj if self.content_type == "amqp/list" : return decodeList(self) if self.content_type == "amqp/map" : @@ -365,9 +368,7 @@ QPID_EXCEPTION(UnauthorizedAccess, SessionError) elif isinstance(content, list) or isinstance(content, dict) : encode(content, self) else : - # Not a type we can handle. Try setting it anyway, - # although this will probably lead to a swig error - self.setContent(str(content)) + self.setContentObject(content) __swig_getmethods__["content"] = _get_content __swig_setmethods__["content"] = _set_content if _newclass: content = property(_get_content, _set_content) -- cgit v1.2.1