[pytango] 30/483: fixes #3295274

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:21 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 adae04c5769a52c6eea28f892330f6f9da59fde1
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Fri May 6 11:52:11 2011 +0000

    fixes #3295274
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@16803 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 src/exception.cpp | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/exception.cpp b/src/exception.cpp
index 2341a06..b11d086 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -259,19 +259,11 @@ void handle_python_exception(boost::python::error_already_set &eas)
     }
 }
 
-struct convert_PyDevFailed_to_DevFailed
+namespace PyDevFailed2DevFailed
 {
-    convert_PyDevFailed_to_DevFailed()
-    {
-        boost::python::converter::registry::push_back(
-            &convertible,
-            &construct,
-            boost::python::type_id<Tango::DevFailed>());
-    }
-
     // Check if given Python object is convertible to a DevFailed.
     // If so, return obj, otherwise return 0
-    static void* convertible(PyObject* obj)
+    void* convertible(PyObject* obj)
     {
         if (PyObject_IsInstance(obj, PyTango_DevFailed.ptr()))
             return obj;
@@ -281,8 +273,8 @@ struct convert_PyDevFailed_to_DevFailed
 
     // Construct a vec3f object from the given Python object, and
     // store it in the stage1 (?) data.
-    static void construct(PyObject* obj,
-                          boost::python::converter::rvalue_from_python_stage1_data* data)
+    void construct(PyObject* obj,
+                   boost::python::converter::rvalue_from_python_stage1_data* data)
     {
         typedef boost::python::converter::rvalue_from_python_storage<Tango::DevFailed> DevFailed_storage;
 
@@ -292,6 +284,15 @@ struct convert_PyDevFailed_to_DevFailed
         PyDevFailed_2_DevFailed(obj, *df_ptr);
         data->convertible = storage;
     }
+
+    void convert_PyDevFailed_to_DevFailed()
+    {
+        boost::python::converter::registry::push_back(
+            &convertible,
+            &construct,
+            boost::python::type_id<Tango::DevFailed>());
+    }
+
 };
 
 
@@ -450,7 +451,7 @@ void export_exceptions()
         .staticmethod("print_error_stack")
     ;
 
-    convert_PyDevFailed_to_DevFailed();
+    PyDevFailed2DevFailed::convert_PyDevFailed_to_DevFailed();
 
     /// NamedDevFailed & family:
     class_<Tango::NamedDevFailed> NamedDevFailed(

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