eric6/DataViews/PyProfileDialog.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7836
2f0d208b8137
--- a/eric6/DataViews/PyProfileDialog.py	Tue Oct 13 19:02:26 2020 +0200
+++ b/eric6/DataViews/PyProfileDialog.py	Wed Oct 14 17:50:39 2020 +0200
@@ -240,9 +240,8 @@
             self.close()
             return
         try:
-            f = open(fname, 'rb')
-            self.stats = pickle.load(f)     # secok
-            f.close()
+            with open(fname, 'rb') as f:
+                self.stats = pickle.load(f)     # secok
         except (EnvironmentError, pickle.PickleError, EOFError):
             E5MessageBox.critical(
                 self,

eric ide

mercurial