eric6/UI/UserInterface.py

changeset 7785
9978016560ec
parent 7781
607a6098cb44
child 7802
eefe954f01e8
child 7804
1cbc27e34ec6
--- a/eric6/UI/UserInterface.py	Tue Oct 13 19:02:26 2020 +0200
+++ b/eric6/UI/UserInterface.py	Wed Oct 14 17:50:39 2020 +0200
@@ -3692,9 +3692,8 @@
             address = BugAddress
         subject = "[eric6] "
         if attachFile is not None:
-            f = open(attachFile, "r", encoding="utf-8")
-            body = f.read()
-            f.close()
+            with open(attachFile, "r", encoding="utf-8") as f:
+                body = f.read()
             if deleteAttachFile:
                 os.remove(attachFile)
         else:

eric ide

mercurial