|
10 | 10 |
|
11 | 11 | from distutils.version import LooseVersion
|
12 | 12 |
|
13 |
| -from ..externals.six import StringIO |
| 13 | +from ..externals.six import BytesIO |
14 | 14 | from xml.parsers.expat import ParserCreate, ExpatError
|
15 | 15 |
|
16 | 16 | import numpy as np
|
@@ -306,25 +306,25 @@ def flush_chardata(self):
|
306 | 306 | pair[1] = data
|
307 | 307 | elif self.write_to == 'Vertices':
|
308 | 308 | # conversion to numpy array
|
309 |
| - c = StringIO(data.strip().decode('utf-8')) |
| 309 | + c = BytesIO(data.strip().encode()) |
310 | 310 | vertices = self.struct_state[-1]
|
311 | 311 | vertices.vertices = np.genfromtxt(c, dtype=np.int)
|
312 | 312 | c.close()
|
313 | 313 | elif self.write_to == 'VoxelIndices':
|
314 | 314 | # conversion to numpy array
|
315 |
| - c = StringIO(data.strip().decode('utf-8')) |
| 315 | + c = BytesIO(data.strip().encode()) |
316 | 316 | parent = self.struct_state[-1]
|
317 | 317 | parent.voxelIndicesIJK.indices = np.genfromtxt(c, dtype=np.int)
|
318 | 318 | c.close()
|
319 | 319 | elif self.write_to == 'VertexIndices':
|
320 | 320 | # conversion to numpy array
|
321 |
| - c = StringIO(data.strip()) |
| 321 | + c = BytesIO(data.strip().encode()) |
322 | 322 | index = self.struct_state[-1]
|
323 | 323 | index.indices = np.genfromtxt(c, dtype=np.int)
|
324 | 324 | c.close()
|
325 | 325 | elif self.write_to == 'TransformMatrix':
|
326 | 326 | # conversion to numpy array
|
327 |
| - c = StringIO(data.strip()) |
| 327 | + c = BytesIO(data.strip().encode()) |
328 | 328 | transform = self.struct_state[-1]
|
329 | 329 | transform.matrix = np.genfromtxt(c, dtype=np.float)
|
330 | 330 | c.close()
|
|
0 commit comments