diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-08-12 13:44:11 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-09-01 11:42:01 +0200 |
commit | 8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e (patch) | |
tree | ac6435b79d3e540e907bcc88e3b1c534c2945626 /make-lint | |
parent | fb7943dab454f358316160b4baf99075603a162d (diff) | |
download | freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.tar.gz freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.tar.xz freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.zip |
Use the print function
In Python 3, `print` is no longer a statement. Call it as a function
everywhere, and include the future import to remove the statement
in Python 2 code as well.
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'make-lint')
-rwxr-xr-x | make-lint | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -20,6 +20,8 @@ # 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 os import sys from optparse import OptionParser @@ -33,7 +35,7 @@ try: from astroid import Class, Instance, Module, InferenceError, Function from pylint.reporters.text import TextReporter except ImportError: - print >> sys.stderr, "To use {0}, please install pylint.".format(sys.argv[0]) + print("To use {0}, please install pylint.".format(sys.argv[0]), file=sys.stderr) sys.exit(32) # File names to ignore when searching for python source files @@ -249,25 +251,25 @@ def main(): linter.check(files) if linter.msg_status != 0: - print >> sys.stderr, """ + print(""" =============================================================================== Errors were found during the static code check. -""" +""", file=sys.stderr) if len(linter.missing) > 0: - print >> sys.stderr, "There are some missing imports:" + print("There are some missing imports:", file=sys.stderr) for mod in sorted(linter.missing): - print >> sys.stderr, " " + mod - print >> sys.stderr, """ + print(" " + mod, file=sys.stderr) + print(""" Please make sure all of the required and optional (python-gssapi, python-rhsm) python packages are installed. -""" +""", file=sys.stderr) - print >> sys.stderr, """\ + print("""\ If you are certain that any of the reported errors are false positives, please mark them in the source code according to the pylint documentation. =============================================================================== -""" +""", file=sys.stderr) if options.fail: return linter.msg_status |