Skip to content

Mac + Glumpy + SDL2, windows timer breaks for loop over backend.windows() #315

@atalkingegg

Description

@atalkingegg

I'm on Mac High Sierra (10.13.6), XCode 10.1, macports, Python 3.11.5, yada, yada.
In glumpy/app/init.py line 262,

for window in backend.windows():
## update a bunch of timers code here..

something in the loop changes the backend.windows() dict object size, generates the error:

File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/glumpy/app/init.py", line 317, in run
clock = init(clock=clock, framerate=framerate, backend=backend)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/glumpy/app/init.py", line 262, in init
for window in backend.windows():
RuntimeError: dictionary changed size during iteration

The fix: change the line to..
for window in list(backend.windows()):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions