Skip to content

Commit

Permalink
Modification needed to run the bootstrap in swapforth/j1b/verilator w…
Browse files Browse the repository at this point in the history
…ith new version of Python 3.

Without that, an error occurs:

Traceback (most recent call last):
  File "/tmp/swapforth/j1b/verilator/shell.py", line 53, in <module>
    swapforth.main(TetheredJ1b)
  File "../../shell/swapforth.py", line 385, in main
    r.shell()
  File "../../shell/swapforth.py", line 339, in shell
    self.shellcmd(cmd)
  File "../../shell/swapforth.py", line 197, in shellcmd
    d = self.serialize()
  File "/tmp/rr/swapforth/j1b/verilator/shell.py", line 49, in serialize
    s = array.array('B', s).tostring().ljust(32768, chr(0xff))
AttributeError: 'array.array' object has no attribute 'tostring'
  • Loading branch information
Wojciech Zabołotny authored and Wojciech Zabołotny committed Aug 27, 2021
1 parent 06c38c5 commit 535d231
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion j1b/verilator/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def serialize(self):
for l in lines:
l = l.split()
s += [int(b, 16) for b in l[1:17]]
s = array.array('B', s).tostring().ljust(32768, chr(0xff))
s = array.array('B', s).tobytes().ljust(32768, bytearray((0xff,)))
return array.array('i', s)

if __name__ == '__main__':
Expand Down

0 comments on commit 535d231

Please sign in to comment.