diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-23 16:04:46 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-23 16:04:46 +0200 |
commit | e03a131bd75bfc478ab9359000d860bd772cff10 (patch) | |
tree | 2d17990dfb4703383dc01428ec4a30c64c81f81e /wee_slack.py | |
parent | 32c591de7e6d8a74af78012e7e543e981a626942 (diff) | |
download | wee-slack-e03a131bd75bfc478ab9359000d860bd772cff10.tar.gz |
Swap elif and else blocks in receive_httprequest_callback
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wee_slack.py b/wee_slack.py index 4c4e0f4..93e15e4 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -491,7 +491,11 @@ class EventRouter(object): dbg("length was zero, probably a bug..") self.delete_context(data) self.receive(request_metadata) - elif return_code != -1: + elif return_code == -1: + if request_metadata.response_id not in self.reply_buffer: + self.reply_buffer[request_metadata.response_id] = StringIO() + self.reply_buffer[request_metadata.response_id].write(out) + else: self.reply_buffer.pop(request_metadata.response_id, None) self.delete_context(data) if request_metadata.request.startswith('rtm.'): @@ -503,10 +507,6 @@ class EventRouter(object): dbg('rtm.start failed with return_code {}. stack:\n{}' .format(return_code, ''.join(traceback.format_stack())), level=5) self.receive(request_metadata) - else: - if request_metadata.response_id not in self.reply_buffer: - self.reply_buffer[request_metadata.response_id] = StringIO() - self.reply_buffer[request_metadata.response_id].write(out) def receive(self, dataobj): """ |