Commits

Jendrik Seipp committed c9ccb43

add support for python3

  • Participants
  • Parent commits 0d9115f

Comments (0)

Files changed (2)

 Installation
 ------------
 
-* vulture requires Python2.7
+* vulture supports Python 2.6, 2.7 and 3.x
 
 You can install, upgrade, uninstall vulture.py with these commands::
 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from __future__ import print_function
+
 import ast
 from fnmatch import fnmatchcase
 import os
                            key=file_lineno):
             relpath = os.path.relpath(item.file)
             path = relpath if not relpath.startswith('..') else item.file
-            print "%s:%d: Unused %s '%s'" % (path, item.lineno, item.typ, item)
+            print("%s:%d: Unused %s '%s'" % (path, item.lineno, item.typ, item))
 
     def get_unused(self, defined, used):
         return list(sorted(set(defined) - set(used), key=lambda x: x.lower()))
                     self._get_line(node))
 
     def log(self, *args):
-        if not self.verbose:
-            return
-        for arg in args:
-            print arg,
-        print
+        if self.verbose:
+            print(*args)
 
     def print_node(self, node):
         self.log(self._get_lineno(node), ast.dump(node), self._get_line(node))