Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r62803:b985e8cf2672
Date: 2013-03-26 00:32 -0700
http://bitbucket.org/pypy/pypy/changeset/b985e8cf2672/
Log: more fixes for the latest merge from default
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -236,8 +236,7 @@
typename)
w_result = space.get_and_call_function(w_impl, self)
- if (space.isinstance_w(w_result, space.w_int) or
- space.isinstance_w(w_result, space.w_long)):
+ if space.isinstance_w(w_result, space.w_int):
return w_result
typename = space.type(w_result).getname(space)
msg = "__int__ returned non-int (type '%s')"
diff --git a/pypy/module/_cffi_backend/ctypeptr.py
b/pypy/module/_cffi_backend/ctypeptr.py
--- a/pypy/module/_cffi_backend/ctypeptr.py
+++ b/pypy/module/_cffi_backend/ctypeptr.py
@@ -360,11 +360,10 @@
def prepare_file_argument(space, w_fileobj):
- fileobj = space.interpclass_w(w_fileobj)
from pypy.module._io.interp_iobase import W_IOBase
- assert isinstance(fileobj, W_IOBase)
+ assert isinstance(w_fileobj, W_IOBase)
space.call_method(w_fileobj, "flush")
- if fileobj.cffi_fileobj is None:
+ if w_fileobj.cffi_fileobj is None:
fd = space.int_w(space.call_method(w_fileobj, "fileno"))
if fd < 0:
raise OperationError(space.w_ValueError,
@@ -372,7 +371,7 @@
fd = os.dup(fd)
mode = space.str_w(space.getattr(w_fileobj, space.wrap("mode")))
try:
- fileobj.cffi_fileobj = CffiFileObj(fd, mode)
+ w_fileobj.cffi_fileobj = CffiFileObj(fd, mode)
except OSError, e:
raise wrap_oserror(space, e)
- return fileobj.cffi_fileobj.llf
+ return w_fileobj.cffi_fileobj.llf
diff --git a/pypy/objspace/std/floatobject.py b/pypy/objspace/std/floatobject.py
--- a/pypy/objspace/std/floatobject.py
+++ b/pypy/objspace/std/floatobject.py
@@ -6,7 +6,7 @@
from pypy.objspace.std.model import registerimplementation, W_Object
from pypy.objspace.std.register_all import register_all
from pypy.objspace.std.noneobject import W_NoneObject
-from pypy.objspace.std.longobject import W_LongObject
+from pypy.objspace.std.longobject import W_LongObject, newlong_from_float
from rpython.rlib.rarithmetic import ovfcheck_float_to_int, intmask, LONG_BIT
from rpython.rlib.rfloat import (
isinf, isnan, isfinite, INFINITY, NAN, copysign, formatd,
@@ -65,7 +65,6 @@
try:
value = ovfcheck_float_to_int(self.floatval)
except OverflowError:
- from pypy.objspace.std.longobject import newlong_from_float
return newlong_from_float(space, self.floatval)
else:
return space.newint(value)
@@ -106,7 +105,7 @@
try:
value = ovfcheck_float_to_int(whole)
except OverflowError:
- return int__Float(space, w_floatobj)
+ return newlong_from_float(space, whole)
else:
return space.newint(value)
diff --git a/pypy/objspace/std/longobject.py b/pypy/objspace/std/longobject.py
--- a/pypy/objspace/std/longobject.py
+++ b/pypy/objspace/std/longobject.py
@@ -24,6 +24,9 @@
def longval(self):
return self.num.tolong()
+ def unwrap(w_self, space): #YYYYYY
+ return w_self.longval()
+
def tofloat(self):
return self.num.tofloat()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit