From fc935db88137d09a19151f007f88540314a30bde Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Thu, 8 Feb 2018 10:17:14 -0800 Subject: Use raw in case string overriden This should reduce confusion in the off-chance that `str` is overridden. Thanks to Taras for the suggestion: https://github.com/dpkp/kafka-python/pull/1320/files#r155716948 --- kafka/protocol/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kafka/protocol/types.py b/kafka/protocol/types.py index d5e446a..87b810c 100644 --- a/kafka/protocol/types.py +++ b/kafka/protocol/types.py @@ -10,7 +10,7 @@ def _pack(f, value): return pack(f, value) except error as e: raise ValueError("Error encountered when attempting to convert value: " - "{} to struct format: '{}', hit error: {}" + "{!r} to struct format: '{}', hit error: {}" .format(value, f, e)) @@ -20,7 +20,7 @@ def _unpack(f, data): return value except error as e: raise ValueError("Error encountered when attempting to convert value: " - "{} to struct format: '{}', hit error: {}" + "{!r} to struct format: '{}', hit error: {}" .format(value, f, e)) -- cgit v1.2.1