diff --git a/coolamqp/framing/base.py b/coolamqp/framing/base.py index 3d7d81d4658cc6c19667d609c25d891bbc79e208..cb47c4b44dc35d24a727ab0cfe45ff75f6f43464 100644 --- a/coolamqp/framing/base.py +++ b/coolamqp/framing/base.py @@ -84,7 +84,11 @@ class AMQPClass(object): class AMQPContentPropertyList(object): """ - A class is intmately bound with content and content properties + A class is intmately bound with content and content properties. + + WARNING: BE PREPARED that if you receive a content from the network, + string values will be memoryviews. Use .tobytes() to correct that. + If YOU create a property list, they will be bytes all right. """ PROPERTIES = [] diff --git a/coolamqp/framing/compilation/utilities.py b/coolamqp/framing/compilation/utilities.py index f35b3810d32793dc4b31fb43db2d48c2966b2db8..345ce923556e3d16b06cfcff68e8c789129a8c8a 100644 --- a/coolamqp/framing/compilation/utilities.py +++ b/coolamqp/framing/compilation/utilities.py @@ -207,7 +207,7 @@ def to_docstring(label, doc, prefix=4, blank=True): # output a full docstring se if len(doc) == 1: return doc[0] - doc = filter(lambda p: len(p.strip()) > 0, doc) + doc = [p for p in doc if len(p.strip()) > 0] if blank: doc = [doc[0], u''] + doc[1:] diff --git a/tests/test_framing/test_compilation.py b/tests/test_framing/test_compilation.py index 6b9cf40b9560122a94a943276387a61fe8d2be73..51840518a40453d0bbbc9b88a13e6fec9d9f4e09 100644 --- a/tests/test_framing/test_compilation.py +++ b/tests/test_framing/test_compilation.py @@ -1,7 +1,4 @@ # coding=UTF-8 -""" -It sounds like a melody -""" from __future__ import print_function, absolute_import, division import six import unittest