[pypy-svn] r74010 - pypy/branch/cpython-extension/pypy/interpreter
afa at codespeak.net
afa at codespeak.net
Fri Apr 23 13:30:45 CEST 2010
Author: afa
Date: Fri Apr 23 13:30:43 2010
New Revision: 74010
Modified:
pypy/branch/cpython-extension/pypy/interpreter/baseobjspace.py
Log:
Merge r74007 and r74008 from trunk
Modified: pypy/branch/cpython-extension/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/interpreter/baseobjspace.py (original)
+++ pypy/branch/cpython-extension/pypy/interpreter/baseobjspace.py Fri Apr 23 13:30:43 2010
@@ -670,7 +670,7 @@
w_s = self.interned_strings[s] = self.wrap(s)
return w_s
- def interpclass_w(space, w_obj):
+ def interpclass_w(self, w_obj):
"""
If w_obj is a wrapped internal interpreter class instance unwrap to it,
otherwise return None. (Can be overridden in specific spaces; you
@@ -717,8 +717,8 @@
raise
break # done
if expected_length != -1 and len(items) == expected_length:
- raise OperationError(space.w_ValueError,
- space.wrap("too many values to unpack"))
+ raise OperationError(self.w_ValueError,
+ self.wrap("too many values to unpack"))
items.append(w_item)
if expected_length != -1 and len(items) < expected_length:
i = len(items)
@@ -726,9 +726,9 @@
plural = ""
else:
plural = "s"
- raise OperationError(space.w_ValueError,
- space.wrap("need more than %d value%s to unpack" %
- (i, plural)))
+ raise OperationError(self.w_ValueError,
+ self.wrap("need more than %d value%s to unpack" %
+ (i, plural)))
return items
def fixedview(self, w_iterable, expected_length=-1):
@@ -1103,16 +1103,16 @@
self.wrap('argument must be a unicode'))
return self.unicode_w(w_obj)
- def path_w(space, w_obj):
+ def path_w(self, w_obj):
""" Like str_w, but if the object is unicode, encode it using
filesystemencoding
"""
- filesystemencoding = space.sys.filesystemencoding
+ filesystemencoding = self.sys.filesystemencoding
if (filesystemencoding and
- space.is_true(space.isinstance(w_obj, space.w_unicode))):
- w_obj = space.call_method(w_obj, "encode",
- space.wrap(filesystemencoding))
- return space.str_w(w_obj)
+ self.is_true(self.isinstance(w_obj, self.w_unicode))):
+ w_obj = self.call_method(w_obj, "encode",
+ self.wrap(filesystemencoding))
+ return self.str_w(w_obj)
def bool_w(self, w_obj):
# Unwraps a bool, also accepting an int for compatibility.
More information about the Pypy-commit
mailing list