Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: in sfml.window.wrap_event, local variable 'event' referenced before assignment  (Read 6037 times)

0 Members and 1 Guest are viewing this topic.

Chronocide

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hi. I've been using the python bindings for a while without problems. Loving it. I think I had manually installed it. I don't recall for sure from where or which now, but it had the convenience wrapper with the sf.Image type usage. Would be nice if I could get that again.
Yesterday I fumbled my os messing with my sources.list, and I think I updated/upgraded the python sfml from the repo. I'm on Debian btw. 1st problem I noticed was the sfml module missing attribute 'Image', etc. Worked around that editing /sfml/__init__.py

So when iterating window.events, and I roll the mouse wheel, this happens:
Traceback (most recent call last):
  File "./ErrorDemo.py", line 8, in <module>
    [e for e in window.events]
  File "src/sfml/window.pyx", line 797, in events_generator (src/sfml/window.cpp:14878)
  File "src/sfml/window.pyx", line 161, in sfml.window.wrap_event (src/sfml/window.cpp:2994)
UnboundLocalError: local variable 'event' referenced before assignment
 
'e= window.events' didn't do it. Only iterating.

Apper lists python-sfml Version:2.2~git20150611.196c88+dfsg-1+b1 Origin:testing.

Ironically, before, I couldn,t get the sfml libs to compile, but the python bindings worked. Now my situation is reversed. I'd like both to work, so I can prototype in python and finalize in cpp.


[edit] I just found the bug report on this issue: https://github.com/Sonkun/python-sfml/issues/115
Sorry for being redundant.
I fixed my problem, reverting to jessie from testing in sources.list.
Thread no longer needed. Good luck with the testing
« Last Edit: August 05, 2015, 09:14:04 am by Chronocide »