Commits

Ronny Pfannschmidt committed ec78f08

remove lnooffset from checker, so the print_function hack is self-contained in the script

  • Participants
  • Parent commits 7771e43
  • Branches experimental

Comments (0)

Files changed (2)

File pyflakes/checker.py

     nodeDepth = 0
     traceTree = False
 
-    def __init__(self, tree, filename='(none)', lnooffset=0, traceTree=False):
+    def __init__(self, tree, filename='(none)', traceTree=False):
         self._deferredFunctions = []
         self._deferredAssignments = []
         self.dead_scopes = []
         self.messages = []
         self.filename = filename
-        self.lnooffset = lnooffset
         self.scopeStack = [ModuleScope()]
         self.traceTree = traceTree
         self.futuresAllowed = True
 
     def report(self, messageClass, *args, **kwargs):
         msg = messageClass(self.filename, *args, **kwargs)
-        msg.lineno -= self.lnooffset
         self.messages.append(msg)
 
     def handleChildren(self, tree):

File pyflakes/scripts/pyflakes.py

         return 1
     else:
         # Okay, it's syntactically valid.  Now check it.
-        w = checker.Checker(tree, filename, lnooffset)
+        w = checker.Checker(tree, filename)
         w.messages.sort(lambda a, b: cmp(a.lineno, b.lineno))
         for warning in w.messages:
+            warning.lineno -= lnooffset
             print warning
         return len(w.messages)