Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning: Expected type 'bool', got 'int' instead #4940

Merged
merged 3 commits into from
Dec 30, 2020
Merged

Fix warning: Expected type 'bool', got 'int' instead #4940

merged 3 commits into from
Dec 30, 2020

Conversation

azenkwed
Copy link
Contributor

Minor fix: twisted.internet.defer.DeferredList parameter consumeErrors expects boolean, got integer instead.

@elacuesta
Copy link
Member

elacuesta commented Dec 28, 2020

Looks correct according to the docs. Could you please also update this line?
When does this warning appear? I couldn't find any occurrences in the tests.

@codecov
Copy link

codecov bot commented Dec 28, 2020

Codecov Report

Merging #4940 (2cb6806) into master (7fec9f9) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4940      +/-   ##
==========================================
+ Coverage   87.88%   88.01%   +0.12%     
==========================================
  Files         158      158              
  Lines        9718     9719       +1     
  Branches     1434     1433       -1     
==========================================
+ Hits         8541     8554      +13     
+ Misses        921      910      -11     
+ Partials      256      255       -1     
Impacted Files Coverage Δ
scrapy/pipelines/media.py 97.16% <100.00%> (ø)
scrapy/utils/defer.py 95.45% <100.00%> (ø)
scrapy/core/downloader/handlers/http11.py 92.46% <0.00%> (-0.57%) ⬇️
scrapy/http/response/__init__.py 97.40% <0.00%> (+0.03%) ⬆️
scrapy/core/scraper.py 89.57% <0.00%> (+2.45%) ⬆️
scrapy/utils/project.py 80.00% <0.00%> (+3.33%) ⬆️
scrapy/utils/ssl.py 70.73% <0.00%> (+17.07%) ⬆️

@Gallaecio
Copy link
Member

Looks like it’s safe to change, as the lowest version of Twisted that we support also has the parameters as booleans in the documentation.

The old syntax can be seen in the documentation of Twisted 10, for example.

@azenkwed
Copy link
Contributor Author

Looks correct according to the docs. Could you please also update this line?
When does this warning appear? I couldn't find any occurrences in the tests.

I will update this line.
fireOnOneErrback should also be updated, as it also expect a boolean, according to the doc.
If the documentation suggest using a boolean, then I advise the update since this update doesn't break the code.

Update defer.py: [Fix warning] Expected type 'bool', got 'int' instead
@elacuesta elacuesta merged commit 44a7ab5 into scrapy:master Dec 30, 2020
@elacuesta
Copy link
Member

Thanks @azenkwed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants