File tree 1 file changed +5
-26
lines changed
1 file changed +5
-26
lines changed Original file line number Diff line number Diff line change @@ -184,28 +184,6 @@ def tar(source, destination):
184
184
shell .call (args + [source ], stderr = shell .DEVNULL )
185
185
186
186
187
- def process_system_exit (e : SystemExit ) -> int :
188
- # According to Python's documents, `SystemExit.code` is the exit status
189
- # or error message that is passed to the constructor. (Defaults to None.)
190
- #
191
- # This means that `SystemExit.code` is either `None`, an `int` object or
192
- # a `string` object of error message.
193
- if e .code is None :
194
- # Fallback to 1 if there is no error code but a `SystemExit`.
195
- return 1
196
- try :
197
- numeric_code = int (e .code )
198
- return numeric_code
199
- except ValueError :
200
- # Fallback to 1 if it is an error message and print that message.
201
- print (e )
202
- return 1
203
- finally :
204
- # Fallback to 1 and do nothing, since there is only ValueError as
205
- # expected exception.
206
- return 1
207
-
208
-
209
187
# -----------------------------------------------------------------------------
210
188
# Argument Validation
211
189
@@ -825,11 +803,12 @@ def main():
825
803
if __name__ == "__main__" :
826
804
try :
827
805
exit_code = main ()
828
- except SystemExit as e :
829
- error_code = process_system_exit ( e )
830
- os . _exit ( error_code )
806
+ log_analyzer ()
807
+ except SystemExit :
808
+ raise
831
809
except KeyboardInterrupt :
832
810
sys .exit (1 )
833
- finally :
811
+ except Exception :
834
812
log_analyzer ()
813
+ raise
835
814
sys .exit (exit_code )
You can’t perform that action at this time.
0 commit comments