Commits

Amaury Forgeot d'Arc  committed 6799443

Fixes

  • Participants
  • Parent commits 46b6229
  • Branches decimal-libmpdec

Comments (0)

Files changed (5)

File pypy/interpreter/error.py

 
 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):

File pypy/module/_decimal/interp_context.py

             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

File pypy/module/_decimal/interp_signals.py

 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),

File pypy/module/_decimal/test/test_ztranslation.py

+
+from pypy.objspace.fake.checkmodule import checkmodule
+
+def test_checkmodule():
+    checkmodule('_decimal')
+

File rpython/rlib/rmpdec.py

 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)