You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library was recently updated as part of the sweep to use with context processors where pylint suggested. But the current way it's implemented does not work properly for this library.
Essentially "releases" or closes the bmp file as soon as the with block ends which means that it is no longer around when the TileGrid is made and added to the display.
Current behavior causes background images not to be shown at all. It will either need to be refactored to have a larger with block that covers the entire time the image is shown. Or go back to the old way of opening the file and managing the closing of it without the with context block and adding the exception for pylint. I lean toward the latter because the file needs to remain open until the next time that set_background() is called again and I don't know if / how a with block can span across multiple function calls like that.
The text was updated successfully, but these errors were encountered:
This library was recently updated as part of the sweep to use
with
context processors where pylint suggested. But the current way it's implemented does not work properly for this library.The code here:
Adafruit_CircuitPython_PYOA/adafruit_pyoa.py
Lines 407 to 410 in a6050d9
Essentially "releases" or closes the bmp file as soon as the
with
block ends which means that it is no longer around when the TileGrid is made and added to the display.Current behavior causes background images not to be shown at all. It will either need to be refactored to have a larger
with
block that covers the entire time the image is shown. Or go back to the old way of opening the file and managing the closing of it without thewith
context block and adding the exception for pylint. I lean toward the latter because the file needs to remain open until the next time thatset_background()
is called again and I don't know if / how awith
block can span across multiple function calls like that.The text was updated successfully, but these errors were encountered: