From ea13e470edcacfcabf50e261660cf009e20463fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Sat, 19 Oct 2024 16:26:28 +0200 Subject: [PATCH] shorter code --- coolamqp/objects.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/coolamqp/objects.py b/coolamqp/objects.py index eb6731d..a7608d4 100644 --- a/coolamqp/objects.py +++ b/coolamqp/objects.py @@ -393,9 +393,8 @@ class NodeDefinition(object): self.host, self.user, self.password, self.virtual_host = args elif len(args) == 1 and isinstance(args[0], (six.text_type, six.binary_type)): - connstr = args[0].decode('utf8') if isinstance(args[0], - six.binary_type) else \ - args[0] + connstr = toutf8(args[0]) + # AMQP connstring if not connstr.startswith(u'amqp://'): raise ValueError(u'should begin with amqp://') -- GitLab