Skip to content

Commit

Permalink
Use time.time() more defensively
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Jan 22, 2020
1 parent d13fb9d commit e563c75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import platform
import shutil
import webbrowser
from time import sleep
from operator import itemgetter
from uuid import uuid4
from copy import deepcopy
from time import sleep, time

from PyQt5.QtCore import *
from PyQt5.QtGui import QIcon, QCursor, QKeySequence
Expand Down Expand Up @@ -623,6 +623,8 @@ def actionSave_trigger(self, event):

def auto_save_project(self):
"""Auto save the project"""
import time

app = get_app()
s = settings.get_settings()

Expand All @@ -640,7 +642,7 @@ def auto_save_project(self):
file_name, file_ext = os.path.splitext(file_name)

# Make copy of unsaved project file in 'recovery' folder
recover_path_with_timestamp = os.path.join(info.RECOVERY_PATH, "%d-%s.osp" % (int(time()), file_name))
recover_path_with_timestamp = os.path.join(info.RECOVERY_PATH, "%d-%s.osp" % (int(time.time()), file_name))
shutil.copy(file_path, recover_path_with_timestamp)

# Find any recovery file older than X auto-saves
Expand Down

0 comments on commit e563c75

Please sign in to comment.