Skip to content

Commit

Permalink
Merge pull request #236 from noam-graetz/Fix-issue-#235
Browse files Browse the repository at this point in the history
fix issue #235: change from type() to isinstance())
  • Loading branch information
Lawouach authored Dec 19, 2017
2 parents cdf50bd + 76d71e8 commit b2cb07e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ws4py/server/cherrypyserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ def _set_internal_flags(self):
break
_locals = current.f_locals
if 'self' in _locals:
if type(_locals['self']) == HTTPRequest:
_locals['self'].close_connection = True
if type(_locals['self']) == HTTPConnection:
_locals['self'].linger = True
# HTTPConnection is more inner than
# HTTPRequest so we can leave once
# we're done here
return
if isinstance(_locals['self'], HTTPRequest):
_locals['self'].close_connection = True
if isinstance(_locals['self'], HTTPConnection):
_locals['self'].linger = True
# HTTPConnection is more inner than
# HTTPRequest so we can leave once
# we're done here
return
_locals = None
current = current.f_back

Expand Down

0 comments on commit b2cb07e

Please # to comment.