Commit 6d1633b5 authored by ulrich_y's avatar ulrich_y
Browse files

In python2, we want proper strings

parent c04ef8ab
......@@ -53,7 +53,10 @@ def read_record(fp, typ):
n = l1 // struct.calcsize(typ)
body = struct.unpack("<"+typ*n, body)
if typ == 'c':
return b''.join(body).decode()
body = b''.join(body).decode()
if type(body) == unicode:
body = body.encode()
return body
else:
if n == 1:
return body[0]
......@@ -131,7 +134,7 @@ def guess_version(fp, inttype='i'):
return 1, inttype
def importvegas(filename="", fp=None, inttype='i'):
def importvegas(filename="", fp=None, inttype='i', returnev=False):
"""
importvegas(filename="", fp=None) loads a vegas file, either
specified by a filename or a file pointer. The function returns a
......@@ -191,6 +194,11 @@ def importvegas(filename="", fp=None, inttype='i'):
else:
dic['chi2a'] = -1
if returnev:
dic['ndo'] = ndo
dic['xi'] = xi
dic['randy'] = randy
if it > 1:
if version >= 3:
ouarray = lambda o, u, b: np.concatenate(([u], b, [o]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment