Ezio Melotti <ezio.melo...@gmail.com> added the comment: >>> OVERRIDE = False >>> SOMETHING = "original" >>> >>> def main(): ... if OVERRIDE: ... SOMETHING = None ... print SOMETHING ... >>> main() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 4, in main UnboundLocalError: local variable 'SOMETHING' referenced before assignment
http://docs.python.org/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value ---------- nosy: +ezio.melotti resolution: invalid -> stage: committed/rejected -> status: closed -> open _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13827> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com