Author: Amaury Forgeot d'Arc <[email protected]>
Branch: decimal-libmpdec
Changeset: r73815:ce9baaf3a921
Date: 2014-10-05 20:09 +0200
http://bitbucket.org/pypy/pypy/changeset/ce9baaf3a921/
Log: More fixes
diff --git a/pypy/module/_decimal/interp_context.py
b/pypy/module/_decimal/interp_context.py
--- a/pypy/module/_decimal/interp_context.py
+++ b/pypy/module/_decimal/interp_context.py
@@ -531,7 +531,7 @@
is_snan=make_bool_method_noctx('mpd_issnan'),
# Functions with a single decimal argument
_apply=interp2app(W_Context.apply_w),
- apply=interp2app(W_Context.apply_w),
+ # apply=interp2app(W_Context.apply_w),
canonical=interp2app(W_Context.canonical_w),
copy_abs=interp2app(W_Context.copy_abs_w),
copy_decimal=interp2app(W_Context.copy_decimal_w),
diff --git a/pypy/module/_decimal/interp_decimal.py
b/pypy/module/_decimal/interp_decimal.py
--- a/pypy/module/_decimal/interp_decimal.py
+++ b/pypy/module/_decimal/interp_decimal.py
@@ -1030,7 +1030,9 @@
def decimal_from_decimal(space, w_subtype, w_value, context, exact=True):
assert isinstance(w_value, W_Decimal)
if exact:
- if space.is_w(w_subtype, space.gettypeobject(W_Decimal.typedef)):
+ if (space.is_w(w_subtype, space.gettypeobject(W_Decimal.typedef)) and
+ space.is_w(space.type(w_value),
+ space.gettypeobject(W_Decimal.typedef))):
return w_value
w_result = W_Decimal.allocate(space, w_subtype)
with interp_context.ConvContext(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit