flathub / org.laptop.TurtleArtActivity

https://flathub.org/apps/details/org.laptop.TurtleArtActivity
1 stars 5 forks source link

Python 3 compatibility issues #4

Open wjt opened 4 years ago

wjt commented 4 years ago

When loading this app I see (as well as some PyGIWarnings about unversioned library imports):

Failed to load Audio_sensors: No module named 'numpy'
Failed to load Camera_sensor: unsupported operand type(s) for +: 'range' and 'list'
Failed to load Rfid: Missing parentheses in call to 'print'. Did you mean print(tagid, idbin, self.rfid_idn)? (rfid.py, line 149)

The first is just a missing library. The second is a change from Python 2:

wjt@gene:~$ python2 -c 'print(range(2) + [3])'
[0, 1, 3]
wjt@gene:~$ python3 -c 'print(range(2) + [3])'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'range' and 'list'

The third is also a 2-to-3 issue.

wjt commented 4 years ago

https://github.com/sugarlabs/turtleart-activity/commit/298011e470d5793728069eb97f5d7fcb4b407037 seems to fix the python 3 problems