From b0a62fc786543b51816b8f75caa901821fe188e5 Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Sun, 8 Oct 2017 04:19:20 +0200 Subject: [PATCH] struct --- coolamqp/framing/compilation/content_property.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/coolamqp/framing/compilation/content_property.py b/coolamqp/framing/compilation/content_property.py index 447666e..29c5ae4 100644 --- a/coolamqp/framing/compilation/content_property.py +++ b/coolamqp/framing/compilation/content_property.py @@ -41,10 +41,7 @@ def _compile_particular_content_property_list_class(zpf, fields): zpf_bits = [zpf_bit or field.type == 'bit' for zpf_bit, field in zip(zpf_bits, fields)] - mod = [u''' -from coolamqp.framing.base import AMQPContentPropertyList -import struct -class ParticularContentTypeList(AMQPContentPropertyList): + mod = [u'''class ParticularContentTypeList(AMQPContentPropertyList): """ For fields: '''] @@ -124,11 +121,11 @@ class ParticularContentTypeList(AMQPContentPropertyList): return u''.join(mod) -import struct def compile_particular_content_property_list_class(zpf, fields): q = _compile_particular_content_property_list_class(zpf, fields) import struct - loc = {'struct': struct} + from coolamqp.framing.base import AMQPContentPropertyList + loc = {'struct': struct, 'AMQPContentPropertyList': AMQPContentPropertyList} exec (q, globals(), loc) return loc['ParticularContentTypeList'] -- GitLab