diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-02-08 10:17:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-08 10:17:14 -0800 |
commit | fc935db88137d09a19151f007f88540314a30bde (patch) | |
tree | 02cd443b94acfe4bcc1fa04154f5024b357e2704 | |
parent | 68068cac13c4cacbe3122cdcba39aa0d3c060b99 (diff) | |
download | kafka-python-use-raw-in-case-string-overriden.tar.gz |
Use raw in case string overridenuse-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
-rw-r--r-- | kafka/protocol/types.py | 4 |
1 files 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)) |