[pypy-commit] pypy decimal-libmpdec: Fixes, and add HAVE_THREADS

amauryfa noreply at buildbot.pypy.org
Wed May 21 00:23:51 CEST 2014


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: decimal-libmpdec
Changeset: r71621:61369511c423
Date: 2014-05-18 23:56 +0200
http://bitbucket.org/pypy/pypy/changeset/61369511c423/

Log:	Fixes, and add HAVE_THREADS

diff --git a/pypy/module/_decimal/__init__.py b/pypy/module/_decimal/__init__.py
--- a/pypy/module/_decimal/__init__.py
+++ b/pypy/module/_decimal/__init__.py
@@ -19,8 +19,10 @@
         'IEEE_CONTEXT_MAX_BITS': 'space.wrap(interp_decimal.IEEE_CONTEXT_MAX_BITS)',
         'MAX_PREC': 'space.wrap(interp_decimal.MAX_PREC)',
         'MAX_EMAX': 'space.wrap(interp_decimal.MAX_EMAX)',
-        'MAX_EMIN': 'space.wrap(interp_decimal.MAX_EMIN)',
-        'MAX_ETINY': 'space.wrap(interp_decimal.MAX_ETINY)',
+        'MIN_EMIN': 'space.wrap(interp_decimal.MIN_EMIN)',
+        'MIN_ETINY': 'space.wrap(interp_decimal.MIN_ETINY)',
+
+        'HAVE_THREADS': 'space.wrap(space.config.translation.thread)',
         }
     for name in rmpdec.ROUND_CONSTANTS:
         interpleveldefs[name] = 'space.wrap(%r)' % name
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
@@ -14,8 +14,8 @@
 IEEE_CONTEXT_MAX_BITS = rmpdec.MPD_IEEE_CONTEXT_MAX_BITS
 MAX_PREC = rmpdec.MPD_MAX_PREC
 MAX_EMAX = rmpdec.MPD_MAX_EMAX
-MAX_EMIN = rmpdec.MPD_MAX_EMIN
-MAX_ETINY = rmpdec.MPD_MAX_ETINY
+MIN_EMIN = rmpdec.MPD_MIN_EMIN
+MIN_ETINY = rmpdec.MPD_MIN_ETINY
 
 # DEC_MINALLOC >= MPD_MINALLOC
 DEC_MINALLOC = 4
diff --git a/pypy/module/_decimal/test/test_module.py b/pypy/module/_decimal/test/test_module.py
--- a/pypy/module/_decimal/test/test_module.py
+++ b/pypy/module/_decimal/test/test_module.py
@@ -48,3 +48,7 @@
             assert issubclass(ex, _decimal.DecimalException)
             assert issubclass(ex, ArithmeticError)
 
+    def test_threads(self):
+        import _decimal
+        assert (_decimal.HAVE_THREADS is False or
+                _decimal.HAVE_THREADS is True)
diff --git a/rpython/rlib/rmpdec.py b/rpython/rlib/rmpdec.py
--- a/rpython/rlib/rmpdec.py
+++ b/rpython/rlib/rmpdec.py
@@ -91,8 +91,8 @@
         'MPD_IEEE_CONTEXT_MAX_BITS')
     MPD_MAX_PREC = platform.ConstantInteger('MPD_MAX_PREC')
     MPD_MAX_EMAX = platform.ConstantInteger('MPD_MAX_EMAX')
-    MPD_MAX_EMIN = platform.ConstantInteger('MPD_MAX_EMIN')
-    MPD_MAX_ETINY = platform.ConstantInteger('MPD_MAX_ETINY')
+    MPD_MIN_EMIN = platform.ConstantInteger('MPD_MIN_EMIN')
+    MPD_MIN_ETINY = platform.ConstantInteger('MPD_MIN_ETINY')
     MPD_MAX_SIGNAL_LIST = platform.ConstantInteger('MPD_MAX_SIGNAL_LIST')
     MPD_SIZE_MAX = platform.ConstantInteger('MPD_SIZE_MAX')
     MPD_SSIZE_MAX = platform.ConstantInteger('MPD_SSIZE_MAX')


More information about the pypy-commit mailing list