Unbound Local error? How?

2006-06-27 Thread Hari Sekhon
I've got some code as follows: import re re_regexname = re.compile('abc') . . various function defs . def func1(): ... func2() ... def func2(): if re_regexname.match('abc'): do something if __name__ == '__main__': func1() but this returns the

Re: Unbound Local error? How?

2006-06-27 Thread Diez B. Roggisch
Hari Sekhon wrote: import re re_regexname = re.compile('abc') . . various function defs . def func1(): ... func2() ... def func2(): if re_regexname.match('abc'): do something if __name__ == '__main__': func1() The above clearly is not what you have. See the

Re: Unbound Local error? How?

2006-06-27 Thread Hari Sekhon
Diez B. Roggisch wrote: Hari Sekhon wrote: import re re_regexname = re.compile('abc') . . various function defs . def func1(): ... func2() ... def func2(): if re_regexname.match('abc'): do something if __name__ == '__main__': func1() The above clearly

Re: Unbound Local error? How?

2006-06-27 Thread Bruno Desthuilliers
Hari Sekhon wrote: I've got some code as follows: import re re_regexname = re.compile('abc') . . various function defs . def func1(): ... func2() ... def func2(): if re_regexname.match('abc'): do something if __name__ == '__main__': func1()

Re: Unbound Local error? How?

2006-06-27 Thread Hari Sekhon
Bruno Desthuilliers wrote: Hari Sekhon wrote: I've got some code as follows: import re re_regexname = re.compile('abc') . . various function defs . def func1(): ... func2() ... def func2(): if re_regexname.match('abc'): do something if __name__

Re: Unbound Local error? How?

2006-06-27 Thread Steve Holden
Hari Sekhon wrote: Bruno Desthuilliers wrote: Hari Sekhon wrote: I've got some code as follows: import re re_regexname = re.compile('abc') . . various function defs . def func1(): ... func2() ... def func2(): if re_regexname.match('abc'): do something if