diff --git a/js2py/base.py b/js2py/base.py index cf1eca08..ce9fda66 100644 --- a/js2py/base.py +++ b/js2py/base.py @@ -250,7 +250,7 @@ def is_generic_descriptor(desc): ############################################################################## - +@six.python_2_unicode_compatible class PyJs(object): PRIMITIVES = frozenset( ['String', 'Number', 'Boolean', 'Undefined', 'Null']) @@ -952,7 +952,7 @@ def create(self, *args): '''Generally not a constructor, raise an error''' raise MakeError('TypeError', '%s is not a constructor' % self.Class) - def __unicode__(self): + def __str__(self): return self.to_string().value def __repr__(self): diff --git a/js2py/host/console.py b/js2py/host/console.py index 50a08632..3d099630 100644 --- a/js2py/host/console.py +++ b/js2py/host/console.py @@ -1,3 +1,4 @@ +from __future__ import print_function from ..base import * @Js @@ -6,7 +7,8 @@ def console(): @Js def log(): - print(arguments[0]) + args = arguments + print(*(args[i] for i in args)) console.put('log', log) console.put('debug', log)