@@ -97,23 +97,23 @@ def stop(self, nowait=False):
97
97
This asks the thread to terminate, and then waits for it to do so.
98
98
Note that if you don't call this before your application exits, there
99
99
may be some records still left on the queue, which won't be processed.
100
- If nowait is False then thread will handle remaining items in queue and
100
+ If nowait is False then thread will handle remaining items in queue and
101
101
stop.
102
- If nowait is True then thread will be stopped even if the queue still
102
+ If nowait is True then thread will be stopped even if the queue still
103
103
contains items.
104
104
"""
105
105
self ._stop .set ()
106
106
if nowait :
107
107
self ._stop_nowait .set ()
108
108
self .queue .put_nowait (self ._sentinel_item )
109
- if (self ._thread .isAlive ()
110
- and self ._thread is not threading .currentThread ()):
109
+ if (self ._thread .isAlive () and
110
+ self ._thread is not threading .currentThread ()):
111
111
self ._thread .join ()
112
112
self ._thread = None
113
113
114
114
115
115
class ReportPortalServiceAsync (object ):
116
- """Wrapper around service class to transparently provide async operations
116
+ """Wrapper around service class to transparently provide async operations
117
117
to agents."""
118
118
119
119
def __init__ (self , endpoint , project , token , api_base = "api/v1" ,
@@ -125,13 +125,14 @@ def __init__(self, endpoint, project, token, api_base="api/v1",
125
125
project: project name to use for launch names.
126
126
token: authorization token.
127
127
api_base: defaults to api/v1, can be changed to other version.
128
- error_handler: function to be called to handle errors occured during
129
- items processing (in thread)
128
+ error_handler: function to be called to handle errors occurred
129
+ during items processing (in thread)
130
130
"""
131
131
super (ReportPortalServiceAsync , self ).__init__ ()
132
132
self .error_handler = error_handler
133
133
self .log_batch_size = log_batch_size
134
- self .rp_client = ReportPortalService (endpoint , project , token , api_base )
134
+ self .rp_client = ReportPortalService (
135
+ endpoint , project , token , api_base )
135
136
self .log_batch = []
136
137
self .supported_methods = ["start_launch" , "finish_launch" ,
137
138
"start_test_item" , "finish_test_item" , "log" ]
@@ -156,7 +157,7 @@ def terminate(self, nowait=False):
156
157
try :
157
158
if not nowait :
158
159
self ._post_log_batch ()
159
- except Exception as err :
160
+ except Exception :
160
161
if self .error_handler :
161
162
self .error_handler (sys .exc_info ())
162
163
else :
@@ -200,7 +201,7 @@ def process_item(self, item):
200
201
else :
201
202
self ._post_log_batch ()
202
203
getattr (self .rp_client , method )(** kwargs )
203
- except Exception as err :
204
+ except Exception :
204
205
if self .error_handler :
205
206
if not self .error_handler (sys .exc_info ()):
206
207
self .terminate (nowait = True )
0 commit comments