MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / _error_popup_with_traceback

Function _error_popup_with_traceback

PySimpleGUI/PySimpleGUI.py:22098–22131  ·  view source on GitHub ↗
(title, *args, emoji=None)

Source from the content-addressed store, hash-verified

22096
22097
22098def _error_popup_with_traceback(title, *args, emoji=None):
22099 if SUPPRESS_ERROR_POPUPS:
22100 return
22101 if _PopupErrorGlobals.showing_error:
22102 return
22103 _PopupErrorGlobals.showing_error = True
22104
22105 trace_details = traceback.format_stack()
22106 error_message = ''
22107 file_info_pysimplegui = None
22108 for line in reversed(trace_details):
22109 if __file__ not in line:
22110 file_info_pysimplegui = line.split(",")[0]
22111 error_message = line
22112 break
22113 if file_info_pysimplegui is None:
22114 _error_popup_with_code(title, None, None, 'Did not find your traceback info', *args, emoji=emoji)
22115 _PopupErrorGlobals.showing_error = False
22116 return
22117
22118 error_parts = None
22119 if error_message != '':
22120 error_parts = error_message.split(', ')
22121 if len(error_parts) < 4:
22122 error_message = error_parts[0] + '\n' + error_parts[1] + '\n' + ''.join(error_parts[2:])
22123 if error_parts is None:
22124 print('*** Error popup attempted but unable to parse error details ***')
22125 print(trace_details)
22126 _PopupErrorGlobals.showing_error = False
22127 return
22128 filename = error_parts[0][error_parts[0].index('File ') + 5:]
22129 line_num = error_parts[1][error_parts[1].index('line ') + 5:]
22130 _error_popup_with_code(title, filename, line_num, error_message, *args, emoji=emoji)
22131 _PopupErrorGlobals.showing_error = False
22132
22133
22134def _error_popup_with_code(title, filename, line_num, *args, emoji=None):

Callers 15

set_focusMethod · 0.85
block_focusMethod · 0.85
get_next_focusMethod · 0.85
get_previous_focusMethod · 0.85
_widget_was_createdMethod · 0.85
updateMethod · 0.85
set_ibeam_colorMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
__init__Method · 0.85
updateMethod · 0.85
select_indexMethod · 0.85

Calls 1

_error_popup_with_codeFunction · 0.85

Tested by

no test coverage detected