Skip to content

Commit

Permalink
fix Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jul 13, 2017
1 parent 2bc30f5 commit 29af092
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fpylll/fplll/integer_matrix.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1456,13 +1456,14 @@ cdef class IntegerMatrix:
line = line.groups()[0]
line = line.strip()
line = [e for e in line.split(" ") if e != '']
ncols = len(line)
values = map(int, line)
if (<IntegerMatrix>A)._type == ZT_MPZ:
(<IntegerMatrix>A)._core.mpz.set_rows(i+1)
(<IntegerMatrix>A)._core.mpz.set_cols(len(values))
(<IntegerMatrix>A)._core.mpz.set_cols(ncols)
elif (<IntegerMatrix>A)._type == ZT_LONG:
(<IntegerMatrix>A)._core.long.set_rows(i+1)
(<IntegerMatrix>A)._core.long.set_cols(len(values))
(<IntegerMatrix>A)._core.long.set_cols(ncols)
else:
raise RuntimeError("Integer type '%s' not understood."%(<IntegerMatrix>A)._type)

Expand Down

0 comments on commit 29af092

Please sign in to comment.