From 26ebfe3e1fccba23576f98ebbbd120a49d504b15 Mon Sep 17 00:00:00 2001 From: Ross Hendrickson Date: Sun, 8 Sep 2013 15:09:10 -0500 Subject: [PATCH] Fix remove bug when removing gcode only files --- octoprint/gcodefiles.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/octoprint/gcodefiles.py b/octoprint/gcodefiles.py index a1847737..5a4e26df 100644 --- a/octoprint/gcodefiles.py +++ b/octoprint/gcodefiles.py @@ -208,11 +208,13 @@ class GcodeManager: if absolutePath is None: return - - if stlPath: + + # The files may or may not actually exits on the HD. + try: + os.remove(absolutePath) os.remove(stlPath) - - os.remove(absolutePath) + except OSError: + pass if filename in self._metadata.keys(): del self._metadata[filename]