Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/MDSplus/mdsscalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _mimport(name, level=1):

import numpy as _N
import ctypes as _C
import sys

_dat = _mimport('mdsdata')
_arr = _mimport('mdsarray')
Expand Down Expand Up @@ -434,7 +435,10 @@ def _descriptor(self):
def fromDescriptor(cls, d):
if d.length == 0:
return cls('')
return cls(_N.array(_C.cast(d.pointer, _C.POINTER((_C.c_byte*d.length))).contents[:], dtype=_N.uint8).tostring())
if sys.version_info.major == 2: # needed for rhel7 and ubuntu14
return cls(_N.array(_C.cast(d.pointer, _C.POINTER((_C.c_byte*d.length))).contents[:], dtype=_N.uint8).tostring())
else:
return cls(_N.array(_C.cast(d.pointer, _C.POINTER((_C.c_byte*d.length))).contents[:], dtype=_N.uint8).tobytes())

def __radd__(self, y):
"""radd: x.__radd__(y) <==> y+x
Expand Down