Author: Amaury Forgeot d'Arc <[email protected]>
Branch: decimal-libmpdec
Changeset: r71453:67994435c7e0
Date: 2014-05-05 22:39 +0200
http://bitbucket.org/pypy/pypy/changeset/67994435c7e0/
Log: Fixes
diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -431,7 +431,7 @@
class OpErrFmtNoArgs(OperationError):
def __init__(self, w_type, value):
- self._value = value
+ self._value = value.decode('ascii')
self.setup(w_type)
def _compute_value(self, space):
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
@@ -197,8 +197,8 @@
if status & (rmpdec.MPD_Inexact |
rmpdec.MPD_Rounded |
rmpdec.MPD_Clamped):
- rmpdec.seterror(self.mpd,
- rmpdec.MPD_Invalid_operation, status_ptr)
+ rmpdec.mpd_seterror(
+ self.mpd, rmpdec.MPD_Invalid_operation, self.status_ptr)
status = rffi.cast(lltype.Signed, self.status_ptr[0])
lltype.free(self.status_ptr, flavor='raw')
status &= rmpdec.MPD_Errors
diff --git a/pypy/module/_decimal/interp_signals.py
b/pypy/module/_decimal/interp_signals.py
--- a/pypy/module/_decimal/interp_signals.py
+++ b/pypy/module/_decimal/interp_signals.py
@@ -1,5 +1,6 @@
from rpython.rlib import rmpdec
from rpython.rlib.unroll import unrolling_iterable
+from pypy.interpreter.error import oefmt
SIGNAL_MAP = unrolling_iterable([
('InvalidOperation', rmpdec.MPD_IEEE_Invalid_operation),
diff --git a/pypy/module/_decimal/test/test_ztranslation.py
b/pypy/module/_decimal/test/test_ztranslation.py
new file mode 100644
--- /dev/null
+++ b/pypy/module/_decimal/test/test_ztranslation.py
@@ -0,0 +1,6 @@
+
+from pypy.objspace.fake.checkmodule import checkmodule
+
+def test_checkmodule():
+ checkmodule('_decimal')
+
diff --git a/rpython/rlib/rmpdec.py b/rpython/rlib/rmpdec.py
--- a/rpython/rlib/rmpdec.py
+++ b/rpython/rlib/rmpdec.py
@@ -143,6 +143,9 @@
mpd_free = external(
'mpd_free', [rffi.VOIDP], lltype.Void, macro=True)
+mpd_seterror = external(
+ 'mpd_seterror', [MPD_PTR, rffi.UINT, rffi.UINTP], lltype.Void)
+
# Conversion
mpd_to_sci_size = external(
'mpd_to_sci_size', [rffi.CCHARPP, MPD_PTR, rffi.INT], rffi.SSIZE_T)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit