[pytango] 341/483: fix bug when user gives empty list of attributes

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:57 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 72366a27d80966e1c29493f772ecdd7794a27cc0
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Mon Dec 9 07:25:06 2013 +0000

    fix bug when user gives empty list of attributes
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@24496 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 src/boost/cpp/device_attribute.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/boost/cpp/device_attribute.h b/src/boost/cpp/device_attribute.h
index 23828ee..fa40a23 100644
--- a/src/boost/cpp/device_attribute.h
+++ b/src/boost/cpp/device_attribute.h
@@ -122,6 +122,12 @@ namespace PyDeviceAttribute {
     template<typename TDeviceAttribute>
     boost::python::object convert_to_python(const unique_pointer<std::vector<TDeviceAttribute> >& dev_attr_vec, Tango::DeviceProxy & dev_proxy, PyTango::ExtractAs extract_as)
     {
+		if (dev_attr_vec->empty())
+		{
+			boost::python::list ls;
+			return ls;
+		}
+
         update_data_format(dev_proxy, &(*dev_attr_vec)[0], dev_attr_vec->size());
 
         // Convert the c++ vector of DeviceAttribute into a pythonic list

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