From d830aeae66d08499bcffe0521e6e2f2cdc0c2394 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 13 Aug 2015 17:15:42 +0200 Subject: [PATCH] Correct bug on assign on RdWr Glob var. --- src/SALOMESDS/SalomeSDSClt.py | 5 +++-- src/SALOMESDS/TestSalomeSDS.py | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SALOMESDS/SalomeSDSClt.py b/src/SALOMESDS/SalomeSDSClt.py index 47a5acb3f..71216f852 100644 --- a/src/SALOMESDS/SalomeSDSClt.py +++ b/src/SALOMESDS/SalomeSDSClt.py @@ -89,9 +89,10 @@ class WrappedType(SALOMEWrappedStdType.WrappedType): return (self._wrapped_type,(self.local_copy(),)) def assign(self,elt): - assert(isinstance(self._var_ptr,SALOME._objref_PickelizedPyObjRdWrServer)) + ptrCorba=self._var_ptr.ptr() + assert(isinstance(ptrCorba,SALOME._objref_PickelizedPyObjRdWrServer)) st=cPickle.dumps(elt,cPickle.HIGHEST_PROTOCOL) - self._var_ptr.setSerializedContent(st) + ptrCorba.setSerializedContent(st) pass def __del__(self): diff --git a/src/SALOMESDS/TestSalomeSDS.py b/src/SALOMESDS/TestSalomeSDS.py index bd333ca39..76ef0dd74 100644 --- a/src/SALOMESDS/TestSalomeSDS.py +++ b/src/SALOMESDS/TestSalomeSDS.py @@ -248,6 +248,9 @@ class SalomeSDSTest(unittest.TestCase): # play a["ab"]=4 self.assertEqual(a.local_copy(),{"ab":4}) + a.assign({"ab":5}) + self.assertEqual(a.local_copy(),{"ab":5}) + a.assign({"ab":4}) a["cd"]=[5] self.assertEqual(a.local_copy(),{"ab":4,"cd":[5]}) a["cd"].append(77) -- 2.39.2