[pytango] 27/483: assure event_id uniqueness

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 db3a0b60158f5b9b277f9cb6252f110acefc0249
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Tue May 3 17:20:45 2011 +0000

    assure event_id uniqueness
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@16775 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 PyTango/device_proxy.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/PyTango/device_proxy.py b/PyTango/device_proxy.py
index 179005e..1b14e70 100644
--- a/PyTango/device_proxy.py
+++ b/PyTango/device_proxy.py
@@ -38,7 +38,7 @@ from _PyTango import AttributeInfo, AttributeInfoEx
 from _PyTango import AttributeInfoList, AttributeInfoListEx
 from _PyTango import DeviceProxy
 from _PyTango import __CallBackAutoDie, __CallBackPushEvent, EventType
-from _PyTango import DevFailed
+from _PyTango import DevFailed, Except
 from _PyTango import ExtractAs
 from PyTango.utils import seq_2_StdStringVector, StdStringVector_2_seq
 from PyTango.utils import seq_2_DbData, DbData_2_dict
@@ -707,6 +707,13 @@ def __DeviceProxy__subscribe_event ( self, attr_name, event_type, cb_or_queuesiz
     event_id = self.__subscribe_event(attr_name, event_type, cb, filters, stateless, extract_as)
 
     se = self.__get_event_map()
+    evt_data = se.get(event_id)
+    if evt_data is not None:
+        desc = "Internal PyTango error:\n" \
+               "%s.subscribe_event(%s, %s) already has key %d assigned to (%s, %s)\n" \
+               "Please report error to PyTango" % \
+               (self, attr_name, event_type, event_id, evt_data[2], evt_data[1])
+        Except.throw_exception("Py_InternalError", desc, "DeviceProxy.subscribe_event")
     se[event_id] = (cb, event_type, attr_name)
     return event_id
 

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