[pypy-svn] r42131 - pypy/dist/pypy/objspace/std
fijal at codespeak.net
fijal at codespeak.net
Tue Apr 17 17:55:07 CEST 2007
Author: fijal
Date: Tue Apr 17 17:55:06 2007
New Revision: 42131
Modified:
pypy/dist/pypy/objspace/std/formatting.py
pypy/dist/pypy/objspace/std/stringobject.py
pypy/dist/pypy/objspace/std/unicodeobject.py
Log:
Use space.w_None instead of real None, bad fijal.
Modified: pypy/dist/pypy/objspace/std/formatting.py
==============================================================================
--- pypy/dist/pypy/objspace/std/formatting.py (original)
+++ pypy/dist/pypy/objspace/std/formatting.py Tue Apr 17 17:55:06 2007
@@ -419,7 +419,7 @@
return self.fmt[i:j]
-def format(space, w_fmt, w_values, w_valuedict=None, do_unicode=False):
+def format(space, w_fmt, w_values, w_valuedict, do_unicode=False):
vb = ValueGetter(space, w_values, w_valuedict)
if not do_unicode:
return _format(space, space.str_w(w_fmt), vb)
@@ -515,7 +515,7 @@
def check_consumed(self):
space = self.space
if (self._valueindex < len(self.values_w) and
- self.w_valuedict is None):
+ space.is_w(self.w_valuedict, space.w_None)):
raise OperationError(space.w_TypeError,
space.wrap('not all arguments converted '
'during string formatting'))
Modified: pypy/dist/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/stringobject.py (original)
+++ pypy/dist/pypy/objspace/std/stringobject.py Tue Apr 17 17:55:06 2007
@@ -918,7 +918,7 @@
# (values is of a mapping type)
def mod__String_ANY(space, w_format, w_values):
if space.is_true(space.isinstance(w_values, space.w_tuple)):
- return format(space, w_format, w_values)
+ return format(space, w_format, w_values, space.w_None)
else:
# we check directly for dict to avoid obscure checking
# in simplest case
@@ -929,7 +929,7 @@
space.newtuple([w_values]), w_values)
else:
return format(space, w_format,
- space.newtuple([w_values]), None)
+ space.newtuple([w_values]), space.w_None)
# register all methods
from pypy.objspace.std import stringtype
Modified: pypy/dist/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/unicodeobject.py (original)
+++ pypy/dist/pypy/objspace/std/unicodeobject.py Tue Apr 17 17:55:06 2007
@@ -1036,7 +1036,7 @@
def mod__Unicode_ANY(space, w_format, w_values):
if space.is_true(space.isinstance(w_values, space.w_tuple)):
- return format(space, w_format, w_values, do_unicode=True)
+ return format(space, w_format, w_values, space.w_None, do_unicode=True)
else:
# we check directly for dict to avoid obscure checking
# in simplest case
@@ -1048,7 +1048,7 @@
do_unicode=True)
else:
return format(space, w_format,
- space.newtuple([w_values]), None,
+ space.newtuple([w_values]), space.w_None,
do_unicode=True)
More information about the Pypy-commit
mailing list