11# -*- coding: utf-8 -*-
2- # Copyright (C) 2008-2010, 2013-2016 Rocky Bernstein <rocky@gnu.org>
2+ #
3+ # Copyright (C) 2008-2010, 2013-2016, 2023 Rocky Bernstein <rocky@gnu.org>
34#
45# This program is free software: you can redistribute it and/or modify
56# it under the terms of the GNU General Public License as published by
1314#
1415# You should have received a copy of the GNU General Public License
1516# along with this program. If not, see <http://www.gnu.org/licenses/>.
16- import inspect , linecache , sys , traceback
17- import pyficache
17+ import inspect
18+ import linecache
19+ import sys
20+ import traceback
1821from reprlib import Repr
1922
20- from trepan import vprocessor as Mprocessor
21- from trepan import exception as Mexcept , misc as Mmisc
22- from trepan .lib import bytecode as Mbytecode , display as Mdisplay
23- from trepan .lib import thred as Mthread
23+ import pyficache
24+
25+ from trepan import exception as Mexcept , misc as Mmisc , vprocessor as Mprocessor
2426from trepan .bwprocessor import location as Mlocation , msg as Mmsg
27+ from trepan .lib import bytecode as Mbytecode , display as Mdisplay , thred as Mthread
2528
2629
2730def get_stack (f , t , botframe , proc_obj = None ):
@@ -224,7 +227,7 @@ def eval(self, arg):
224227 """Eval string arg in the current frame context."""
225228 try :
226229 return eval (arg , self .curframe .f_globals , self .curframe .f_locals )
227- except :
230+ except Exception :
228231 t , v = sys .exc_info ()[:2 ]
229232 if isinstance (t , str ):
230233 exc_type_name = t
@@ -249,7 +252,7 @@ def exec_line(self, line):
249252 try :
250253 code = compile (line + "\n " , '"%s"' % line , "single" )
251254 exec (code , global_vars , local_vars )
252- except :
255+ except Exception :
253256 t , v = sys .exc_info ()[:2 ]
254257 if isinstance (t , bytes ):
255258 exc_type_name = t
@@ -265,7 +268,7 @@ def ok_for_running(self, cmd_obj, name, cmd_hash):
265268 if the command has the right number of arguments and so on.
266269 """
267270 if hasattr (cmd_obj , "execution_set" ):
268- if not ( self .core .execution_status in cmd_obj .execution_set ) :
271+ if self .core .execution_status not in cmd_obj .execution_set :
269272 part1 = "Command '%s' is not available for execution " "status:" % name
270273 Mmsg .errmsg (
271274 self ,
@@ -357,7 +360,7 @@ def process_command(self):
357360 except (Mexcept .DebuggerQuit , Mexcept .DebuggerRestart , SystemExit ):
358361 # Let these exceptions propagate through
359362 raise
360- except :
363+ except Exception :
361364 Mmsg .errmsg (self , "INTERNAL ERROR: " + traceback .format_exc ())
362365 pass
363366 pass
@@ -433,7 +436,7 @@ def _populate_commands(self):
433436 import_name = "command." + mod_name
434437 try :
435438 command_mod = getattr (__import__ (import_name ), mod_name )
436- except :
439+ except Exception :
437440 print ("Error importing %s: %s" % (mod_name , sys .exc_info ()[0 ]))
438441 continue
439442
@@ -447,7 +450,7 @@ def _populate_commands(self):
447450 try :
448451 instance = eval (eval_cmd )
449452 cmd_instances .append (instance )
450- except :
453+ except Exception :
451454 print (
452455 "Error loading %s from %s: %s"
453456 % (classname , mod_name , sys .exc_info ()[0 ])
0 commit comments