Corrected a glitch in the eric web browser session manager. eric7

Fri, 05 Aug 2022 15:07:54 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 05 Aug 2022 15:07:54 +0200
branch
eric7
changeset 9280
94f4e2751790
parent 9279
e252f827aaa7
child 9281
76caf27cb8a8

Corrected a glitch in the eric web browser session manager.

src/eric7/WebBrowser/Session/SessionManager.py file | annotate | diff | comparison | revisions
--- a/src/eric7/WebBrowser/Session/SessionManager.py	Wed Aug 03 11:54:32 2022 +0200
+++ b/src/eric7/WebBrowser/Session/SessionManager.py	Fri Aug 05 15:07:54 2022 +0200
@@ -277,11 +277,12 @@
         if os.path.exists(self.__lastActiveSession):
 
             if os.path.exists(self.__sessionBackup1):
-                os.unlink(self.__sessionBackup2)
-                shutil.copy(self.__sessionBackup1, self.__sessionBackup2)
+                if os.path.exists(self.__sessionBackup2):
+                    os.remove(self.__sessionBackup2)
+                shutil.copy2(self.__sessionBackup1, self.__sessionBackup2)
+                os.remove(self.__sessionBackup1)
 
-            os.unlink(self.__sessionBackup1)
-            shutil.copy(self.__lastActiveSession, self.__sessionBackup1)
+            shutil.copy2(self.__lastActiveSession, self.__sessionBackup1)
 
     def sessionMetaData(self, includeBackups=False):
         """

eric ide

mercurial