Author: Antonio Cuni <[email protected]>
Branch: rpython-unicode-formatting
Changeset: r56137:e6b358af9c93
Date: 2012-07-18 14:28 +0200
http://bitbucket.org/pypy/pypy/changeset/e6b358af9c93/
Log: failing test and fix
diff --git a/pypy/rpython/rpbc.py b/pypy/rpython/rpbc.py
--- a/pypy/rpython/rpbc.py
+++ b/pypy/rpython/rpbc.py
@@ -11,7 +11,7 @@
mangle, inputdesc, warning, impossible_repr
from pypy.rpython import rclass
from pypy.rpython import robject
-from pypy.rpython.annlowlevel import llstr
+from pypy.rpython.annlowlevel import llstr, llunicode
from pypy.rpython import callparse
@@ -612,6 +612,9 @@
def ll_str(self, none):
return llstr("None")
+ def ll_unicode(self, none):
+ return llunicode(u"None")
+
def get_ll_hash_function(self):
return ll_none_hash
diff --git a/pypy/rpython/test/test_runicode.py
b/pypy/rpython/test/test_runicode.py
--- a/pypy/rpython/test/test_runicode.py
+++ b/pypy/rpython/test/test_runicode.py
@@ -200,10 +200,17 @@
const = self.const
def percentS(s):
return const("before %s after") % (s,)
-
+ #
res = self.interpret(percentS, [const(u'à')])
assert self.ll_to_string(res) == const(u'before à after')
-
+ #
+
+ def test_strformat_unicode_arg_None(self):
+ const = self.const
+ def percentS(s):
+ return const("before %s after") % (s,)
+ res = self.interpret(percentS, [None])
+ assert self.ll_to_string(res) == const(u'before None after')
def unsupported(self):
py.test.skip("not supported")
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit