This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients benjamin.peterson, ezio.melotti, hippmr, michael.foord
Date 2012-01-19.16:08:34
SpamBayes Score 0.00017373169
Marked as misclassified No
Message-id <1326989315.33.0.318781960663.issue13827@psf.upfronthosting.co.za>
In-reply-to
Content
>>> 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
History
Date User Action Args
2012-01-19 16:08:35ezio.melottisetrecipients: + ezio.melotti, benjamin.peterson, michael.foord, hippmr
2012-01-19 16:08:35ezio.melottisetmessageid: <1326989315.33.0.318781960663.issue13827@psf.upfronthosting.co.za>
2012-01-19 16:08:34ezio.melottilinkissue13827 messages
2012-01-19 16:08:34ezio.melotticreate