Skip to content

Commit

Permalink
Merge pull request #1112 from twisted/9597-comparison-warning
Browse files Browse the repository at this point in the history
Author: wiml
Reviewer: rodrigc
Fixes: ticket:9597

Use 'is'/'is not' instead of '==' to avoid Py3 warnings about comparing disparate types
  • Loading branch information
wiml committed Mar 22, 2019
2 parents 085f30c + 4cb71f9 commit 29cbea3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/twisted/web/distrib.py
Expand Up @@ -114,7 +114,7 @@ def __init__(self, request):
self.request = request

def finished(self, result):
if result != server.NOT_DONE_YET:
if result is not server.NOT_DONE_YET:
assert isinstance(result, str), "return value not a string"
self.request.write(result)
self.request.finish()
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion src/twisted/web/server.py
Expand Up @@ -311,7 +311,7 @@ def render(self, resrc):
body = epage.render(self)
# end except UnsupportedMethod

if body == NOT_DONE_YET:
if body is NOT_DONE_YET:
return
if not isinstance(body, bytes):
body = resource.ErrorPage(
Expand Down

0 comments on commit 29cbea3

Please sign in to comment.