Skip to content

Commit bbe35d5

Browse files
committed
Python 3.5 fix: replace __dict__ by getattr
1 parent 4f25a1d commit bbe35d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

influxdb/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ def _json_body_(cls):
143143
}
144144

145145
for field in cls._fields:
146-
json_point['fields'][field] = point.__dict__[field]
146+
json_point['fields'][field] = getattr(point, field)
147147

148148
for tag in cls._tags:
149-
json_point['tags'][tag] = point.__dict__[tag]
149+
json_point['tags'][tag] = getattr(point, tag)
150150

151151
json.append(json_point)
152152
return json

influxdb/influxdb08/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _json_body_(cls):
137137
for series_name, data in six.iteritems(cls._datapoints):
138138
json.append({'name': series_name,
139139
'columns': cls._fields,
140-
'points': [[point.__dict__[k] for k in cls._fields]
140+
'points': [[getattr(point, k) for k in cls._fields]
141141
for point in data]
142142
})
143143
return json

0 commit comments

Comments
 (0)