Skip to content

Commit

Permalink
Fix thread join exception
Browse files Browse the repository at this point in the history
AttributeError: 'RuntimeError' object has no attribute 'message'
  • Loading branch information
volconst committed Jul 31, 2020
1 parent ac7f959 commit 5cffab7
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions printrun/printcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,17 +530,12 @@ def pause(self):
self.paused = True
self.printing = False

# try joining the print thread: enclose it in try/except because we
# might be calling it from the thread itself
try:
self.print_thread.join()
except RuntimeError as e:
if e.message == "cannot join current thread":
pass
else:
# ';@pause' in the gcode file calls pause from the print thread
if not threading.current_thread() is self.print_thread:
try:
self.print_thread.join()
except:
self.logError(traceback.format_exc())
except:
self.logError(traceback.format_exc())

self.print_thread = None

Expand Down

0 comments on commit 5cffab7

Please sign in to comment.