- made sure that the KeyboardInterrupt exception is not logged to the log.txt file
This commit is contained in:
@@ -16,6 +16,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- changed the translators tab in the on_about() method
|
- changed the translators tab in the on_about() method
|
||||||
- added the usage of the FCLabel widget instead of QtWidgets.QLabel
|
- added the usage of the FCLabel widget instead of QtWidgets.QLabel
|
||||||
- cleaning up Isolation Plugin
|
- cleaning up Isolation Plugin
|
||||||
|
- made sure that the KeyboardInterrupt exception is not logged to the log.txt file
|
||||||
|
|
||||||
17.08.2021
|
17.08.2021
|
||||||
|
|
||||||
|
|||||||
21
FlatCAM.py
21
FlatCAM.py
@@ -132,18 +132,19 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
def excepthook(exc_type, exc_value, exc_tb):
|
def excepthook(exc_type, exc_value, exc_tb):
|
||||||
msg = '%s\n' % str(datetime.today())
|
msg = '%s\n' % str(datetime.today())
|
||||||
msg += "".join(traceback.format_exception(exc_type, exc_value, exc_tb))
|
if exc_type != KeyboardInterrupt:
|
||||||
|
msg += "".join(traceback.format_exception(exc_type, exc_value, exc_tb))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(log_file_path) as f:
|
with open(log_file_path) as f:
|
||||||
log_file = f.read()
|
log_file = f.read()
|
||||||
log_file += '\n' + msg
|
log_file += '\n' + msg
|
||||||
|
|
||||||
with open(log_file_path, 'w') as f:
|
with open(log_file_path, 'w') as f:
|
||||||
f.write(log_file)
|
f.write(log_file)
|
||||||
except IOError:
|
except IOError:
|
||||||
with open(log_file_path, 'w') as f:
|
with open(log_file_path, 'w') as f:
|
||||||
f.write(msg)
|
f.write(msg)
|
||||||
QtWidgets.QApplication.quit()
|
QtWidgets.QApplication.quit()
|
||||||
# or QtWidgets.QApplication.exit(0)
|
# or QtWidgets.QApplication.exit(0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user