8000 For python2/3 compat. · mattrobenolt/influxdb-python@e8ea370 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8ea370

Browse files
author
Grégory Starck
committed
For python2/3 compat.
1 parent d86ad1f commit e8ea370

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

influxdb/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
class InfluxDBClientError(Exception):
2020
"""Raised when an error occurs in the request"""
2121
def __init__(self, content, code):
22+
if isinstance(content, type(b'')):
23+
content = content.decode('UTF-8', errors='replace')
2224
super(InfluxDBClientError, self).__init__(
23 3F45 25
"{0}: {1}".format(code, content))
2426
self.content = content

0 commit comments

Comments
 (0)
0