Skip to content

Commit ef374f0

Browse files
committed
traceback.format_exc does not take an error
I have no idea why this code did that. As far as I can tell, format_exc *never* took an error, and this will cause a crash in py3.
1 parent 5de2ef5 commit ef374f0

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Mopy/bash/bash.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ def _import_wx():
8686
# moved/deleted wx modules
8787
from wx import _core
8888
sys.modules['wx._gdi'] = _core
89-
except Exception as e:
89+
except:
9090
but_kwargs = {'text': _(u"QUIT"),
9191
'fg': 'red'} # foreground button color
9292
msg = u'\n'.join([dump_environment(), u'', u'Unable to load wx:',
93-
traceback.format_exc(e), u'Exiting.'])
93+
traceback.format_exc(), u'Exiting.'])
9494
_tkinter_error_dial(msg, but_kwargs)
9595
sys.exit(1)
9696

@@ -204,15 +204,15 @@ def main(opts):
204204
wx_locale = localize.setup_locale(opts.language, _wx)
205205
try:
206206
_main(opts, wx_locale)
207-
except Exception as e:
207+
except:
208208
msg = u'\n'.join([
209209
_(u'Wrye Bash encountered an error.'),
210210
_(u'Please post the information below to the official thread at'),
211211
_(u'https://afkmods.com/index.php?/topic/4966-wrye-bash-all-games'),
212212
_(u'or to the Wrye Bash Discord at'),
213213
_(u'https://discord.gg/NwWvAFR'),
214214
u'',
215-
traceback.format_exc(e)
215+
traceback.format_exc()
216216
])
217217
_close_dialog_windows()
218218
_show_wx_error(msg)
@@ -288,10 +288,10 @@ def _main(opts, wx_locale):
288288
env.isUAC = env.testUAC(bush_game.gamePath.join(bush_game.mods_dir))
289289
global basher, balt
290290
from . import basher, balt
291-
except (exception.BoltError, ImportError, OSError, IOError) as e:
291+
except (exception.BoltError, ImportError, OSError, IOError):
292292
msg = u'\n'.join([_(u'Error! Unable to start Wrye Bash.'), u'\n', _(
293293
u'Please ensure Wrye Bash is correctly installed.'), u'\n',
294-
traceback.format_exc(e)])
294+
traceback.format_exc()])
295295
_close_dialog_windows()
296296
_show_wx_error(msg)
297297
return
@@ -466,13 +466,13 @@ def __init__(self, msg):
466466
'fg': 'red'} # foreground button color
467467
_tkinter_error_dial(msg, but_kwargs)
468468

469-
except Exception as e:
469+
except:
470470
print(u'Wrye Bash encountered an error but could not display it.')
471471
print(u'The following is the error that occurred when displaying the '\
472472
u'first error:')
473473
try:
474-
print(traceback.format_exc(e))
475-
except Exception:
474+
print(traceback.format_exc())
475+
except:
476476
print(u' An error occurred while displaying the second error.')
477477

478478
def _tkinter_error_dial(msg, but_kwargs):

0 commit comments

Comments
 (0)