can one specify python 2 or 3 with code inspections?

(I've had this problem since Pycharm EAP 141.988 - I'm still having it with the 4.3 release)

I have a django project that I had inadvertently created a python3 virtualenv for (I deleted it and remade it using python 2.7.9) where I'm getting some odd inspection errors - notably the cmp function from the std library was being flagged as not resolving.

def _imgsizecmp(x, y):
    if x.width and x.height and y.width and y.height:
        return cmp(x.width * x.height, y.width * y.height)


Also, the super method is giving me a "method can not be resolved" error in code like this:  

    def save(self, **kwargs):
        unique_slug(self, slug_source='title', slug_field='name', check_current_slug=kwargs.get('force_insert'))
        super(Collection, self).save(kwargs)


Screen Shot 2015-07-10 at 9.30.47 AM.png



I just noticed in another file a message about Python 3.3 not supporting this syntax:

logging.error('Image derivative failed for media %d (%s)' % (master.id, e))


So I'm guessing the project was set somewhere to be in Python33 when I goofed making the new virtualenv and that it's now stuck - or does anyone have a guess as to how I can fix this? It's causing every file I open to report numerous serious errors (but to be clear, the code runs like it has for the last few years))
0

Please sign in to leave a comment.