Ticket #9828: 1_str_to_bytes.patch

File 1_str_to_bytes.patch, 1.2 KB (added by robertwb, 12 years ago)
  • sage/matrix/matrix_mod2_dense.pyx

    # HG changeset patch
    # User Craig Citro <craigcitro@gmail.com>
    # Date 1275088749 25200
    # Node ID 9cf98092ffa5a54860cd6a42255d23119db57e8a
    # Parent  ae0f8252b44f9176e4ddfcda9acf9b8d397dc70a
    Explicitly type string literals as bytes objects to make Cython happy.
    
    diff -r ae0f8252b44f -r 9cf98092ffa5 sage/matrix/matrix_mod2_dense.pyx
    a b  
    462462        cdef list row_div, col_div
    463463        if self.subdivisions is not None:
    464464            row_s = empty_row
    465             div_s = row_divider = "[%s]" % ("-" * (self._ncols*2-1))
     465            div_s = row_divider = b"[%s]" % ("-" * (self._ncols*2-1))
    466466            row_div, col_div = self.get_subdivisions()
    467467            last_i = 0
    468468            for i in col_div:
     
    474474                last_i = i
    475475           
    476476        for i from 0 <= i < self._nrows:
    477             row_s = row = "[%s]" % empty_row
     477            row_s = row = b"[%s]" % empty_row
    478478            for j from 0 <= j < self._ncols:
    479479                row_s[1+2*j] = c'0' + mzd_read_bit(self._entries,i,j)
    480480            s.append(row)