summaryrefslogtreecommitdiff
path: root/odoo/cli/shell.py
diff options
context:
space:
mode:
authorxmo-odoo <xmo@odoo.com>2017-04-25 13:27:54 +0200
committerGitHub <noreply@github.com>2017-04-25 13:27:54 +0200
commit6b9268bd15f8db22855d91849749b879f2d553a1 (patch)
treea14ed2a0ff1b4eafb0f94b0dfafcea34187499bf /odoo/cli/shell.py
parent3cbca4b7348b60eb6cfe3f423983d53dada67862 (diff)
[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
Diffstat (limited to 'odoo/cli/shell.py')
-rw-r--r--odoo/cli/shell.py7
1 files changed, 4 insertions, 3 deletions
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: