Skip to content

Commit bfb7002

Browse files
authored
change from type() to isinstance())
type() check for exact match, which failed to detect the subclass used by WS4PY
1 parent cdf50bd commit bfb7002

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ws4py/server/cherrypyserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ def _set_internal_flags(self):
272272
break
273273
_locals = current.f_locals
274274
if 'self' in _locals:
275-
if type(_locals['self']) == HTTPRequest:
275+
if isinstance(_locals['self'], HTTPRequest):
276276
_locals['self'].close_connection = True
277-
if type(_locals['self']) == HTTPConnection:
277+
if isinstance(_locals['self'], HTTPConnection):
278278
_locals['self'].linger = True
279279
# HTTPConnection is more inner than
280280
# HTTPRequest so we can leave once

0 commit comments

Comments
 (0)