Author: bugman Date: Sun Jun 16 14:50:12 2013 New Revision: 20148 URL: http://svn.gna.org/viewcvs/relax?rev=20148&view=rev Log: Fixes for how the devel_scripts/find_unused_imports.py script runs pylint. Modified: trunk/devel_scripts/find_unused_imports.py Modified: trunk/devel_scripts/find_unused_imports.py URL: http://svn.gna.org/viewcvs/relax/trunk/devel_scripts/find_unused_imports.py?rev=20148&r1=20147&r2=20148&view=diff ============================================================================== --- trunk/devel_scripts/find_unused_imports.py (original) +++ trunk/devel_scripts/find_unused_imports.py Sun Jun 16 14:50:12 2013 @@ -3,7 +3,7 @@ """Find all unused imports within all relax *.py files using the pylint program.""" # Python module imports. -from os import getcwd, path, waitpid, sep, walk +from os import getcwd, path, sep, walk from re import search from subprocess import PIPE, Popen import sys @@ -29,13 +29,12 @@ cmd = 'pylint %s' % path # Execute. - pipe = Popen(cmd, shell=True, stdout=PIPE, close_fds=False) - waitpid(pipe.pid, 0) + pipe = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False) - # The STDOUT data. - data = pipe.stdout.readlines() + # Close the pipe. + pipe.stdin.close() # Only display the import information. - for line in data: + for line in pipe.stdout.readlines(): if search("Unused import", line): sys.stdout.write(" %s\n" % line[:-1])