Skip to content

Commit bb04693

Browse files
author
Elijah North
committed
Fixed both StreamConn._handlers and StreamConn.polygon._handlers referencing the same object and thus causing KeyErrors on StreamConn.deregister()
1 parent 7918a13 commit bb04693

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

alpaca_trade_api/stream2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ async def _ensure_polygon(self):
6868
if 'staging' in self._base_url:
6969
key_id += '-staging'
7070
self.polygon = polygon.StreamConn(key_id)
71-
self.polygon._handlers = self._handlers
72-
self.polygon._handler_symbols = self._handler_symbols
71+
self.polygon._handlers = self._handlers.copy()
72+
self.polygon._handler_symbols = self._handler_symbols.copy()
7373
await self.polygon.connect()
7474

7575
async def _ensure_ws(self):

0 commit comments

Comments
 (0)