arduino / arduino-alvik-mpy

Alvik Robot library
Mozilla Public License 2.0
9 stars 2 forks source link

Alvik instance error #31

Open eigen-value opened 6 days ago

eigen-value commented 6 days ago

On multiple calls to ArduinoAlvik.stop you got the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/arduino_alvik/arduino_alvik.py", line 381, in stop
AttributeError: 'type' object has no attribute '_instance'

Unbinding the current instance from the ArduinoAlvik singleton class in the stop method is IMO useless and has potential side effects like:

The right way would be unbinding the instance right before it is deleted. Unfortunately the special method 'del' is not implemented in MP for user defined classes, see here