Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"items" can become empty after f8 ? #9

Open
zeffii opened this issue Feb 17, 2020 · 1 comment
Open

"items" can become empty after f8 ? #9

zeffii opened this issue Feb 17, 2020 · 1 comment

Comments

@zeffii
Copy link

zeffii commented Feb 17, 2020

while items:
if isinstance(bpy.context, _RestrictContext):
break
try:
text = items.pop()
scrollback(c_dict, text=text, type=type)
ok = True
except RuntimeError:
ok = False
break
if not ok:
if text:
items.insert(0, text)
return delayed_scrollback("\n".join(items), c_dict, type)

in that case the while loop is never entered, and the line below it if not ok will throw a

  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\run_in_console.py", line 107, in scrollback_append
    if not ok:
UnboundLocalError: local variable 'ok' referenced before assignment

location: <unknown location>:-1

nortikin/sverchok#2884

@zeffii
Copy link
Author

zeffii commented Feb 17, 2020

or maybe

 while items: 
     if isinstance(bpy.context, _RestrictContext): 
         break 

is what causes ok to be non-existent when line 109 is executed after f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant