mirror of https://github.com/scrapy/scrapy.git
Use augmented assignment statements (#5322)
This commit is contained in:
parent
28eba610e2
commit
c316ca45a5
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue