Use augmented assignment statements (#5322)

This commit is contained in:
Alex 2021-11-16 01:20:56 -08:00 committed by GitHub
parent 28eba610e2
commit c316ca45a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -213,7 +213,7 @@ class TunnelingAgent(Agent):
# proxy host and port are required for HTTP pool `key`
# otherwise, same remote host connection request could reuse
# a cached tunneled connection to a different proxy
key = key + self._proxyConf
key += self._proxyConf
return super()._requestWithEndpoint(
key=key,
endpoint=endpoint,

View File

@ -285,8 +285,8 @@ class Stream:
self._protocol.conn.send_data(self.stream_id, data_chunk, end_stream=False)
bytes_to_send_size = bytes_to_send_size - chunk_size
self.metadata['remaining_content_length'] = self.metadata['remaining_content_length'] - chunk_size
bytes_to_send_size -= chunk_size
self.metadata['remaining_content_length'] -= chunk_size
self.metadata['remaining_content_length'] = max(0, self.metadata['remaining_content_length'])

View File

@ -22,7 +22,7 @@ class SignalCatcherSpider(Spider):
return spider
def on_request_left(self, request, spider):
self.caught_times = self.caught_times + 1
self.caught_times += 1
class TestCatching(TestCase):