From 9687d7db79e15846de385537a99525d11cae6a15 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 12 Dec 2014 11:04:40 +0100 Subject: Python3 support in SSSD https://fedorahosted.org/sssd/ticket/2017 (cherry picked from commit 341a00311680a440d7f979f06c34c70d86c9367a) --- contrib/rhel/update_debug_levels.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'contrib/rhel') diff --git a/contrib/rhel/update_debug_levels.py b/contrib/rhel/update_debug_levels.py index a9462625f..a260ec1e8 100644 --- a/contrib/rhel/update_debug_levels.py +++ b/contrib/rhel/update_debug_levels.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import os import sys import shutil @@ -27,19 +29,19 @@ by default""") help="Be verbose") (options, args) = parser.parse_args() if len(args) > 0: - print >>sys.stderr, "Stray arguments: %s" % ' '.join([a for a in args]) + print("Stray arguments: %s" % ' '.join([a for a in args]), file=sys.stderr) return None return options def verbose(msg, verbosity): if verbosity: - print msg + print(msg) def main(): options = parse_options() if not options: - print >> sys.stderr, "Cannot parse options" + print("Cannot parse options", file=sys.stderr) return 1 # Import the current config file @@ -47,8 +49,8 @@ def main(): sssdconfig = SSSDConfig.SSSDConfig() sssdconfig.import_config() - except Exception, e: - print "Error: %s" % e + except Exception as e: + print("Error: %s" % e) verbose(traceback.format_exc(), options.verbose) return 2 -- cgit