[pytango] 40/98: Fix #19: Define new members in DeviceProxy has sisde effects

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


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

sbodomerle-guest pushed a commit to tag v9.2.0
in repository pytango.

commit 21d5f165c7300c807db33f81b2c1ff49b4a69d5e
Author: Jose Tiago Macara Coutinho <coutinhotiago at gmail.com>
Date:   Mon Jun 6 10:50:37 2016 +0200

    Fix #19: Define new members in DeviceProxy has sisde effects
---
 src/boost/python/device_proxy.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/boost/python/device_proxy.py b/src/boost/python/device_proxy.py
index 92f5d11..7b1ccb6 100644
--- a/src/boost/python/device_proxy.py
+++ b/src/boost/python/device_proxy.py
@@ -268,6 +268,9 @@ def __DeviceProxy__getattr(self, name):
 def __DeviceProxy__setattr(self, name, value):
     name_l = name.lower()
 
+    if name_l in self.__get_cmd_cache():
+        raise TypeError('Cannot set the value of a command')
+
     if name_l in self.__get_attr_cache():
         return self.write_attribute(name, value)
 
@@ -275,6 +278,14 @@ def __DeviceProxy__setattr(self, name, value):
         return self.write_pipe(name, value)
 
     try:
+        self.__refresh_cmd_cache()
+    except:
+        pass
+
+    if name_l in self.__get_cmd_cache():
+        raise TypeError('Cannot set the value of a command')
+
+    try:
         self.__refresh_attr_cache()
     except:
         pass

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