Commit 2de7489e authored by Guilhem Saurel's avatar Guilhem Saurel

[Python 3] import print function everywhere

parent 9030b1dc
unitTesting/test_python-syntax_error.py
Subproject commit d14225f15cff165773176ae0740d0ee79767ff93
Subproject commit 63efaecd7c1fa3f9c190b5365561c38ea33f3236
......@@ -3,6 +3,8 @@ Copyright (c) 2010 CNRS
Author: Florent Lamiraux
"""
from __future__ import print_function
import sys
from . import entity # noqa
......
......@@ -9,6 +9,8 @@
# >>> e.a.b.c.d( ...)
# as if it was a classical member function of e.
from __future__ import print_function
class CommandPath(object):
"""
......
......@@ -3,6 +3,8 @@
Author: Florent Lamiraux, Nicolas Mansard
"""
from __future__ import print_function
import types
from enum import Enum
......
......@@ -4,6 +4,8 @@
# using the str() member.
# The statics prec, space and fullPrec can be used to modify the display.
from __future__ import print_function
def pseudozero(prec):
"""
......
......@@ -8,6 +8,8 @@
# entity -> same as print(entity)
# change the prompt to be '%'
from __future__ import print_function
# Changing prompt
import sys
......
......@@ -3,6 +3,9 @@
Author: Florent Lamiraux
"""
from __future__ import print_function
import re
from .wrap import (create_signal_wrapper, signal_base_display, signal_base_display_dependencies,
......
# -*- coding: utf-8 -*-
# Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
from __future__ import print_function
def addTrace(robot, trace, entityName, signalName, autoRecompute=True):
"""
......
......@@ -11,7 +11,8 @@ std::ofstream dg_debugfile("/tmp/dynamic-graph-traces.txt", std::ios::trunc& std
// Python initialization commands
namespace dynamicgraph {
namespace python {
static const std::string pythonPrefix[7] = {"import traceback\n",
static const std::string pythonPrefix[8] = {"from __future__ import print_function\n",
"import traceback\n",
"class StdoutCatcher:\n"
" def __init__(self):\n"
" self.data = ''\n"
......@@ -98,6 +99,7 @@ Interpreter::Interpreter() {
PyRun_SimpleString(pythonPrefix[4].c_str());
PyRun_SimpleString(pythonPrefix[5].c_str());
PyRun_SimpleString(pythonPrefix[6].c_str());
PyRun_SimpleString(pythonPrefix[7].c_str());
PyRun_SimpleString("import linecache");
// Allow threads
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment