timothycrosley / deprecated.frosted

A simple program which checks Python source files for errors.
MIT License
250 stars 23 forks source link

changes in AST from Python 3.5 on #59

Open magro11 opened 8 years ago

magro11 commented 8 years ago

Hi Timothy,

some scripts lead to an exception raised in checker.py, method checkCall, line 229 of the latest version of frosted. The exception is:

AttributeError: 'Call' object has no attribute 'starargs'.

One exemplary script is:

`def test(self): pass

def poll(self): poll = test()`

The reason might be, that the ast module does not provide the starargs attribute anymore for the object Call since Python 3.5 (see for instance http://greentreesnakes.readthedocs.io/en/latest/nodes.html#Call).

In many cases, the if-condition is already evaluated after the first len-comparison, therefore the call_node.starargs and call_node.kwargs (which also does not exist since Python 3.5) is not evaluated. Do you have an idea how to overcome this problem?