We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a6e1a5 commit 867dd46Copy full SHA for 867dd46
splunklib/results.py
@@ -246,7 +246,25 @@ def _parse_results(self, stream):
246
elem.clear()
247
248
elif elem.tag in ('text', 'v') and event == 'end':
249
- text = "".join(elem.itertext())
+ try:
250
+ text = "".join(elem.itertext())
251
+ except AttributeError:
252
+ # Assume we're running in Python < 2.7, before itertext() was added
253
+ # So we'll define it here
254
+
255
+ def __itertext(self):
256
+ tag = self.tag
257
+ if not isinstance(tag, basestring) and tag is not None:
258
+ return
259
+ if self.text:
260
+ yield self.text
261
+ for e in self:
262
+ for s in __itertext(e):
263
+ yield s
264
+ if e.tail:
265
+ yield e.tail
266
267
+ text = "".join(__itertext(elem))
268
values.append(text.encode('utf8'))
269
270
0 commit comments