]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Fix runtime warning about unclosed file descriptors vsr/close_file_descriptors
authorvsr <vsr@opencascade.com>
Fri, 23 Aug 2019 11:16:33 +0000 (14:16 +0300)
committervsr <vsr@opencascade.com>
Fri, 23 Aug 2019 11:16:33 +0000 (14:16 +0300)
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/RENUMBER_Swig/MEDRenumberCommon.i

index 5670b093b11c50ba834da093965016c879ae36e4..61c79a2ccd4df3b2e3b0a4effcd5c1987fc4f94c 100644 (file)
@@ -5951,6 +5951,6 @@ MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt.RemoveIdsFrom
 import os
 __filename=os.environ.get('PYTHONSTARTUP')
 if __filename and os.path.isfile(__filename):
-  exec(open(__filename).read())
-  pass
+    with(open(__filename) as __fp):
+        exec(__fp.read())
 %}
index 2224e52f08f989fe5f5581cc3babf8b8683e1b7a..60a28d72ee129b0b60006b691b047ecb9e011750 100644 (file)
@@ -68,6 +68,6 @@ using namespace INTERP_KERNEL;
 import os
 __filename=os.environ.get('PYTHONSTARTUP')
 if __filename and os.path.isfile(__filename):
-  exec(open(__filename).read())
-  pass
+  with(open(__filename) as __fp):
+        exec(__fp.read())
 %}