[pytango] 482/483: Fixes #718

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:15:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.

commit d74b57e09b3967abdb69b32216c71e6574002f0e
Author: coutinho <coutinho at esrf.fr>
Date:   Mon May 11 16:31:29 2015 +0200

    Fixes #718
---
 doc/revision.rst             |  1 +
 src/boost/cpp/fast_from_py.h | 17 +++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/doc/revision.rst b/doc/revision.rst
index aaa1e97..8340007 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -107,6 +107,7 @@ Version history
 |          |     - `701: Memory leak in command with list argument <https://sourceforge.net/p/tango-cs/bugs/701/>`_                                                                |
 |          |     - `704: Assertion failure when calling command with string array input type <https://sourceforge.net/p/tango-cs/bugs/704/>`_                                      |
 |          |     - `705: Support boost_python lib name on Gentoo  <https://sourceforge.net/p/tango-cs/bugs/705/>`_                                                                 |
+|          |     - `718: OverflowErrors with float types in 8.1.6 <https://sourceforge.net/p/tango-cs/bugs/718/>`_                                                                 |
 +----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | 8.1.6    | Bug fixes:                                                                                                                                                            |
 |          |                                                                                                                                                                       |
diff --git a/src/boost/cpp/fast_from_py.h b/src/boost/cpp/fast_from_py.h
index 4abce71..39bfbcc 100644
--- a/src/boost/cpp/fast_from_py.h
+++ b/src/boost/cpp/fast_from_py.h
@@ -95,15 +95,16 @@ struct from_py<tangoTypeConst> \
                 PyErr_SetString(PyExc_TypeError, "Expecting a numeric type, it is not."); \
                 boost::python::throw_error_already_set();  \
             } \
-            if (cpy_value > TangoScalarTypeLimits::max()) { \
-                PyErr_SetString(PyExc_OverflowError, "Value is too large."); \
-                boost::python::throw_error_already_set(); \
-            } \
-            if (cpy_value < TangoScalarTypeLimits::min()) { \
-                PyErr_SetString(PyExc_OverflowError, "Value is too small."); \
-                boost::python::throw_error_already_set(); \
+            if (TangoScalarTypeLimits::is_integer) { \
+                if (cpy_value > TangoScalarTypeLimits::max()) {	\
+                    PyErr_SetString(PyExc_OverflowError, "Value is too large."); \
+                    boost::python::throw_error_already_set(); \
+                } \
+                if (cpy_value < TangoScalarTypeLimits::min()) {	\
+                    PyErr_SetString(PyExc_OverflowError, "Value is too small."); \
+                    boost::python::throw_error_already_set(); \
+                } \
             } \
-            \
             tg = static_cast<TangoScalarType>(cpy_value);  \
         } \
     };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list