blowup with 'isinstance()'

Mar 23, 2012 at 9:09 PM

I can blow up any Python Tools installation in VS 2010 Win7 64bit by using isinstance() with a variable, such as:

if isinstance(m,int)

If I type this in the source code editor or the interpreter, within 1-2 seconds I am guaranteed a blowup.

Any variable name and any type.

Now, I have used isinstance before in my code and have not seen this before, but I some changes per Dinov's suggestions to some debug py files to  allow multithreading in the PTVS.  And now I see this behavior. So I don't know if this is related or not.

Have tried this on two Win7 was a VM and the other a regular install on hardware.  Both cases win7 64bit.   So I know this is unlikely to be a machine or install-specific problem.

Net net, I can't use the isinstance function...something in intellisense really doesn't like it and blows up visual studio predictably and every time.

Any ideas?  I kind of need isinstance to work.




Mar 23, 2012 at 9:14 PM

I doubt it's related to the debug py files.  Does it also happen in any file or is it crashing only in a certain file?  My guess would be that there's something about where you're using it

Any chance you can start a 2nd VS and Debug->Attach to Process for the 1st process, type isinstance, and get the call stack when it crashes?

One possible workaround might be to change the code to:

if (isinstance(m, int)):

I think the extra parens should prevent us from analyzing the isinstance code.