Salome HOME
Add a safe evaluation of a python function which does not throw any exception.
[tools/py2cpp.git] / example / main.cxx
index e07ef3b913b7632f7e57f3554e3c77aa85f620c0..5d2514954435f13137600afebef401aa36a9478b 100644 (file)
@@ -25,6 +25,7 @@
 int main()
 {
   Py_Initialize();
+  {
   std::string s;
   double d;
   py2cpp::PyFunction fn;
@@ -48,6 +49,7 @@ int main()
       std::cerr << err.what();
     }
   }
+  }
   Py_Finalize();
   return 0;
 }