Skip to content

Commit 9aa3d7b

Browse files
committed
Fix a KeyError
1 parent d75234f commit 9aa3d7b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

ringcentral/demos/demo_subscription.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
from ringcentral import SDK
21
from dotenv import load_dotenv
32
import asyncio
3+
import sys
44
import os
5+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) # Add the project root to sys.path
56
from ringcentral.websocket.events import WebSocketEvents
7+
from ringcentral import SDK
68

79
def on_notification(message):
810
print("\n Subscription notification:\n")

ringcentral/websocket/web_socket_subscription.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, web_socket_client):
1717

1818
def on_message(self, message):
1919
message_json = json.loads(message)
20-
if(message_json[0]['type'] == 'ClientRequest' and message_json[0]['headers']['WSG-SubscriptionId']):
20+
if(message_json[0]['type'] == 'ClientRequest' and 'WSG-SubscriptionId' in message_json[0]['headers']):
2121
self.set_subscription(message_json)
2222
self._web_socket_client.trigger(WebSocketEvents.subscriptionCreated, self)
2323
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
VERSION = '0.8.4'
3+
VERSION = '0.8.5'
44

55
setup(
66
name='ringcentral',

0 commit comments

Comments
 (0)