]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL15174 (Dump study works wrong for Concatenate)
authoreap <eap@opencascade.com>
Mon, 12 Mar 2007 09:11:56 +0000 (09:11 +0000)
committereap <eap@opencascade.com>
Mon, 12 Mar 2007 09:11:56 +0000 (09:11 +0000)
     avoid "SyntaxError: can't assign to []"

src/SMESH_I/SMESH_Mesh_i.cxx

index 88773c1afa2bf223ada83def174d3383052b6af9..da4a9b2a019b74162b9351bbb2818e512d9c7bf9 100644 (file)
@@ -757,9 +757,11 @@ SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception)
   if (MYDEBUG) MESSAGE("GetGroups");
 
   SMESH::ListOfGroups_var aList = new SMESH::ListOfGroups();
+
   // Python Dump
   TPythonDump aPythonDump;
-  aPythonDump << "[ ";
+  if ( !_mapGroups.empty() ) // (IMP13463) avoid "SyntaxError: can't assign to []"
+    aPythonDump << "[ ";
 
   try {
     aList->length( _mapGroups.size() );
@@ -779,7 +781,8 @@ SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception)
   }
 
   // Update Python script
-  aPythonDump << " ] = " << _this() << ".GetGroups()";
+  if ( !_mapGroups.empty() ) // (IMP13463) avoid "SyntaxError: can't assign to []"
+    aPythonDump << " ] = " << _this() << ".GetGroups()";
 
   return aList._retn();
 }