Can't figure out where SyntaxError: can not delete variable 'x' referenced in nested scope us coming from in python >=2.6

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Tue Dec 9 23:10:30 EST 2008


On Tue, 09 Dec 2008 22:57:36 -0500, Albert Hopkins wrote:

> On Tue, 2008-12-09 at 22:57 +0000, Steven D'Aprano wrote: [...]
>> > So is there a way to find the offending code w/o having to go
>> through
>> > every line of code in 'foo' by hand?
>> 
>> Just search for "del x" in your code. Your editor does have a search
>> function, surely?
>> 
>> 
>> 
> Well, you'd think I'd be smart enough to think of that one, wouldn't
> you?  Actually, how could you since you don't know me ;-)... Anway, I
> already did that and could not find the offending code.

You should have said :)

 
> I submitted this bug [1]. I applied the given patch but the line it
> shows isn't a "del" anything so I'm even more confused.

Ouch. You have my sympathies.

I guess you're going to have to just import each module one at a time 
until you find the module that fails, then search that one.



-- 
Steven





More information about the Python-list mailing list