Commit 5bfa36db authored by Marius Wachtler's avatar Marius Wachtler

fix attrwrapper.pop and float.imag

parent 3d315a58
......@@ -1122,7 +1122,7 @@ static Box* floatConjugate(Box* b, void*) {
raiseExcHelper(TypeError, "descriptor 'conjugate' requires a 'float' object but received a '%s'",
getTypeName(b));
if (b->cls == float_cls) {
return b;
return incref(b);
} else {
assert(PyFloat_Check(b));
return boxFloat(static_cast<BoxedFloat*>(b)->d);
......
......@@ -2425,8 +2425,9 @@ public:
Box* r = self->b->getattr(key);
if (r) {
Py_INCREF(r);
self->b->delattr(key, NULL);
return incref(r);
return r;
} else {
if (default_)
return incref(default_);
......
......@@ -69,6 +69,7 @@ print (0.5).as_integer_ratio()
print (0.5).is_integer()
print (1.0).is_integer()
print 1.0.__hash__(), 1.1.__hash__(), -1.1.__hash__()
print (0.5).conjugate(), (0.6).imag
print 1.0 ** (10 ** 100)
print (-1.0) ** (10 ** 100)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment