Commits

Brodie Rao  committed 0fc7061

Backing out 515ce2857ed1 - I'll reinstate this when I can get it to stop breaking tests and I can figure out what it's trying to do

  • Participants
  • Parent commits 186c0b2
  • Branches experimental

Comments (0)

Files changed (2)

File pyflakes/checker.py

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

File pyflakes/scripts/pyflakes.py

     """
     # First, compile into an AST and handle syntax errors.
     try:
-        try:
-            tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST)
-            lnooffset = 0
-        except SyntaxError:
-            # HACK: try again with print function
-            tree = compile('from __future__ import print_function\n' +
-                           codeString, filename, "exec", _ast.PyCF_ONLY_AST)
-            lnooffset = 1
+        tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST)
     except SyntaxError, value:
         msg = value.args[0]
 
         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:
             print warning