Skip to content

Commit 9a0401e

Browse files
committed
Merge pull request #236 from noam-graetz/Fix-issue-#235
fix issue #235: change from type() to isinstance())
2 parents 2db4852 + 78f6809 commit 9a0401e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ws4py/server/cherrypyserver.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@ def _set_internal_flags(self):
272272
break
273273
_locals = current.f_locals
274274
if 'self' in _locals:
275-
if type(_locals['self']) == HTTPRequest:
276-
_locals['self'].close_connection = True
277-
if type(_locals['self']) == HTTPConnection:
278-
_locals['self'].linger = True
279-
# HTTPConnection is more inner than
280-
# HTTPRequest so we can leave once
281-
# we're done here
282-
return
275+
if isinstance(_locals['self'], HTTPRequest):
276+
_locals['self'].close_connection = True
277+
if isinstance(_locals['self'], HTTPConnection):
278+
_locals['self'].linger = True
279+
# HTTPConnection is more inner than
280+
# HTTPRequest so we can leave once
281+
# we're done here
282+
return
283283
_locals = None
284284
current = current.f_back
285285

0 commit comments

Comments
 (0)