File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -981,12 +981,12 @@ def taskkill(self):
981981 if self .args .taskkill .isdigit ():
982982 pidList = [int (self .args .taskkill )]
983983 else :
984- r = legacy .hRpcWinStationGetAllProcesses (handle )
985- if not r :
984+ res = legacy .hRpcWinStationGetAllProcesses (handle )
985+ if not res :
986986 self .logger .error ("Could not get process list" )
987987 return
988988
989- pidList = [i ["UniqueProcessId" ] for i in r if i ["ImageName" ].lower () == self .args .taskkill .lower ()]
989+ pidList = [i ["UniqueProcessId" ] for i in res if i ["ImageName" ].lower () == self .args .taskkill .lower ()]
990990 if not pidList :
991991 self .logger .fail (f"Could not find process named { self .args .taskkill } " )
992992 return
@@ -997,9 +997,8 @@ def taskkill(self):
997997 self .logger .highlight (f"Terminated PID { pid } ({ self .args .taskkill } )" )
998998 else :
999999 self .logger .fail (f"Failed terminating PID { pid } " )
1000- except Exception :
1001- import traceback
1002- self .logger .error (f"Error terminating PID { pid } : { traceback .format_exc ()} " )
1000+ except Exception as e :
1001+ self .logger .exception (f"Error terminating PID { pid } : { e } " )
10031002
10041003 @requires_admin
10051004 def qwinsta (self ):
You can’t perform that action at this time.
0 commit comments