From 0873dfaabc7899bbc61b22e9bb3afd9164e0cd0d Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Thu, 26 Aug 2021 17:48:12 +0200 Subject: [PATCH] Fixing bug on windows. --- LogarithmPlotter/logarithmplotter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LogarithmPlotter/logarithmplotter.py b/LogarithmPlotter/logarithmplotter.py index a1189e4..d1d9e13 100644 --- a/LogarithmPlotter/logarithmplotter.py +++ b/LogarithmPlotter/logarithmplotter.py @@ -27,14 +27,14 @@ from PySide2.QtGui import QIcon, QImage, QKeySequence from PySide2 import __version__ as PySide2_version from tempfile import mkstemp -from os import getcwd, chdir, environ, path, remove +from os import getcwd, chdir, environ, path, remove, close from platform import release as os_release from json import dumps, loads from sys import platform, argv, version as sys_version from webbrowser import open as openWeb # Create the temporary file for saving copied screenshots -tmpfile = mkstemp(suffix='.png')[1] +fd, tmpfile = mkstemp(suffix='.png') pwd = getcwd() chdir(path.dirname(path.realpath(__file__))) @@ -198,7 +198,8 @@ def run(): check_for_updates(__VERSION__, engine.rootObjects()[0]) exit_code = app.exec_() - + + close(fd) remove(tmpfile) config.save() exit(exit_code)