Commits

Amaury Forgeot d'Arc committed 739252d

Add Context.clear_flags()

  • Participants
  • Parent commits 502a9fa
  • Branches decimal-libmpdec

Comments (0)

Files changed (1)

pypy/module/_decimal/interp_context.py

         w_copy.capitals = self.capitals
         return w_copy
 
+    def clear_flags_w(self, space):
+        rffi.setintfield(self.ctx, 'c_status', 0)
+
+    def clear_traps_w(self, space):
+        rffi.setintfield(self.ctx, 'c_traps', 0)
+
     def get_prec(self, space):
         return space.wrap(rmpdec.mpd_getprec(self.ctx))
 
     __repr__ = interp2app(W_Context.descr_repr),
     #
     copy=interp2app(W_Context.copy_w),
+    clear_flags=interp2app(W_Context.clear_flags_w),
+    clear_traps=interp2app(W_Context.clear_traps_w),
     create_decimal=interp2app(W_Context.create_decimal_w),
     )