[pytango] 31/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 e664010b9fd59803fac50b84da40aeb7c9d28e20
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Fri May 6 11:53:40 2011 +0000

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

diff --git a/src/exception.cpp b/src/exception.cpp
index b11d086..27e895d 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -259,11 +259,19 @@ void handle_python_exception(boost::python::error_already_set &eas)
     }
 }
 
-namespace PyDevFailed2DevFailed
+struct convert_PyDevFailed_to_DevFailed
 {
+    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
-    void* convertible(PyObject* obj)
+    static void* convertible(PyObject* obj)
     {
         if (PyObject_IsInstance(obj, PyTango_DevFailed.ptr()))
             return obj;
@@ -273,8 +281,8 @@ namespace PyDevFailed2DevFailed
 
     // Construct a vec3f object from the given Python object, and
     // store it in the stage1 (?) data.
-    void construct(PyObject* obj,
-                   boost::python::converter::rvalue_from_python_stage1_data* data)
+    static 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;
 
@@ -284,15 +292,6 @@ namespace PyDevFailed2DevFailed
         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>());
-    }
-
 };
 
 
@@ -451,7 +450,7 @@ void export_exceptions()
         .staticmethod("print_error_stack")
     ;
 
-    PyDevFailed2DevFailed::convert_PyDevFailed_to_DevFailed();
+    convert_PyDevFailed_to_DevFailed pydevfailed_2_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