From ef788564845e0cb722a0e8c6dfd9d9a6d2914e4e Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Tue, 10 Jan 2017 07:14:59 +0100 Subject: [PATCH] py3k --- coolamqp/framing/base.py | 6 +++++- coolamqp/framing/compilation/utilities.py | 2 +- tests/test_framing/test_compilation.py | 3 --- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/coolamqp/framing/base.py b/coolamqp/framing/base.py index 3d7d81d..cb47c4b 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 f35b381..345ce92 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 6b9cf40..5184051 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 -- GitLab