Ronny Pfannschmidt avatar Ronny Pfannschmidt committed ec78f08

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

Comments (0)

Files changed (2)

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):

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)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.