File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 33from warnings import warn
44
55
6- def retry (max_retry ):
6+ def retry (max_retry : int ):
77 warn ("The 'retry' decorator is deprecated" , DeprecationWarning , stacklevel = 2 )
88
99 def inside (func ):
1010
1111 def wrapper (* args , ** kwargs ):
1212 attempt = 0
13- error_output = Exception ()
13+ exception = Exception ()
1414
1515 while max_retry > attempt :
1616 try :
1717 return func (* args , ** kwargs )
1818 except Exception as error :
19- error_output = error
19+ exception = error
2020 attempt += 1
2121
22- raise error_output
22+ raise exception
2323
2424 return wrapper
2525 return inside
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ def time(func):
77 def inside (* args , ** kwargs ):
88 start = datetime .now ()
99 task = func (* args , ** kwargs )
10- task .set_duration = ( datetime .now () - start ).total_seconds ()
10+ task .set_duration (( datetime .now () - start ).total_seconds () )
1111 return task
1212 return inside
You canβt perform that action at this time.
0 commit comments