Skip to content

Commit

Permalink
Fix to maintain backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jgelens committed Nov 28, 2013
1 parent 0154a66 commit 4544cd5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion geventwebsocket/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ def _is_valid_close_code(self, code):

@property
def current_app(self):
return self.handler.server.application.current_app
if hasattr(self.handler.server.application, 'current_app'):
return self.handler.server.application.current_app
else:
class MockApp():
def on_close(self, *args):
pass

return MockApp()

@property
def origin(self):
Expand Down

0 comments on commit 4544cd5

Please sign in to comment.