local variable referenced before assignment
Pete Bartonly
none at try.invalid
Thu Oct 25 05:02:24 EDT 2007
More information about the Python-list mailing list
Thu Oct 25 05:02:24 EDT 2007
- Previous message (by thread): local variable referenced before assignment
- Next message (by thread): local variable referenced before assignment
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Quick question, probably quite a simple matter. Take the follow start of
a method:
def review(filesNeedingReview):
for item in filesNeedingReview:
(tightestOwner, logMsg) = item
if (logMsg != None):
for logInfo in logMsg.changed_paths:
This generates the error:
UnboundLocalError: local variable 'logMsg' referenced before assignment
I thought I'd assigned it in the "(tightestOwner, logMsg) = item" line -
so in the python interpreter complaining about the fact this assignment
might not go well?
Thanks!
- Previous message (by thread): local variable referenced before assignment
- Next message (by thread): local variable referenced before assignment
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list