Update reactor.py, updated 'if' sequencing .#3937
Merged
wRAR merged 1 commit intoscrapy:masterfrom Nov 19, 2019
sbs2001:patch-10
Merged
Update reactor.py, updated 'if' sequencing .#3937wRAR merged 1 commit intoscrapy:masterfrom sbs2001:patch-10
wRAR merged 1 commit intoscrapy:masterfrom
sbs2001:patch-10
Conversation
…ug if portrange=None This should be the proper ordering.This is the explanation. If 'not portrange' is True ,it is guaranteed that `not hasattr(portrange, '__iter__')` is also True the converse of this is not always true.(for example, consider portrange=None, for such case we were executing the logic for `not hasattr(portrange, '__iter__')` . ).Such case is eliminated by this PR.
Codecov Report
@@ Coverage Diff @@
## master #3937 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 166 166
Lines 9681 9681
Branches 1445 1445
=======================================
Hits 8282 8282
Misses 1146 1146
Partials 253 253
|
kmike
approved these changes
Aug 8, 2019
Member
kmike
left a comment
There was a problem hiding this comment.
I don't mind it any way, but the change looks fine to me.
wRAR
approved these changes
Nov 19, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should be the proper ordering.This is the explanation.
If
'not portrange'is True ,it is guaranteed thatnot hasattr(portrange, '__iter__')is also True the converse of this is not always true.(for example, consider portrange=None, for such case we were executing the logic fornot hasattr(portrange, '__iter__'). ).Such case is eliminated by this PR.