Skip to content

Commit

Permalink
change from type() to isinstance())
Browse files Browse the repository at this point in the history
type() check for exact match, which failed to detect the subclass used by WS4PY
  • Loading branch information
noam-graetz authored Dec 10, 2017
1 parent cdf50bd commit bfb7002
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ws4py/server/cherrypyserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ def _set_internal_flags(self):
break
_locals = current.f_locals
if 'self' in _locals:
if type(_locals['self']) == HTTPRequest:
if isinstance(_locals['self'], HTTPRequest):
_locals['self'].close_connection = True
if type(_locals['self']) == HTTPConnection:
if isinstance(_locals['self'], HTTPConnection):
_locals['self'].linger = True
# HTTPConnection is more inner than
# HTTPRequest so we can leave once
Expand Down

0 comments on commit bfb7002

Please sign in to comment.