From 6b9268bd15f8db22855d91849749b879f2d553a1 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Tue, 25 Apr 2017 13:27:54 +0200 Subject: [FIX] print statement -> function In Python 3, ``print`` becomes a builtin function. This is available in Python 2 by importing the ``print_function`` feature from ``__future__``, the feature is conveniently still available in Python 3 (it just does nothing). Fixers: libfuturize.fixes.fix_print_with_import #8530 --- odoo/cli/shell.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'odoo/cli/shell.py') diff --git a/odoo/cli/shell.py b/odoo/cli/shell.py index 1e847800956..320cf5aa3d4 100644 --- a/odoo/cli/shell.py +++ b/odoo/cli/shell.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from __future__ import print_function import code import logging import os @@ -44,7 +45,7 @@ class Console(code.InteractiveConsole): import readline import rlcompleter except ImportError: - print 'readline or rlcompleter not available, autocomplete disabled.' + print('readline or rlcompleter not available, autocomplete disabled.') else: readline.set_completer(rlcompleter.Completer(locals).complete) readline.parse_and_bind("tab: complete") @@ -65,9 +66,9 @@ class Shell(Command): exec sys.stdin in local_vars else: if 'env' not in local_vars: - print 'No environment set, use `%s shell -d dbname` to get one.' % sys.argv[0] + print('No environment set, use `%s shell -d dbname` to get one.' % sys.argv[0]) for i in sorted(local_vars): - print '%s: %s' % (i, local_vars[i]) + print('%s: %s' % (i, local_vars[i])) preferred_interface = config.options.get('shell_interface') if preferred_interface: -- cgit v1.2.3