Unused variables msg should be silenced if locals() is used

Bug #970637 reported by Domen Kožar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
New
Undecided
Unassigned

Bug Description

For example:

  def test(a, b):
          c = do_something(locals())
          return True

Warning for unused variable should be issued only for c, not also a and b.

Revision history for this message
Domen Kožar (ielectric+) wrote :
Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

The example in the description seems invalid to me. Current pyflakes trunk tip will not emit warnings for a and b for that code.

Revision history for this message
Domen Kožar (ielectric+) wrote :

Yes, example in the ticket is not the best. Look at test cases supplied with patch.

Run this through pyflakes: http://paste.pocoo.org/show/577582/
dir() could be any function that makes use of variable a

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.