Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

ValueError: list.remove(x): x not in list ib rpc.py modle #60

Open
Noor-Kalibbala opened this issue Apr 9, 2021 · 3 comments
Open

ValueError: list.remove(x): x not in list ib rpc.py modle #60

Noor-Kalibbala opened this issue Apr 9, 2021 · 3 comments

Comments

@Noor-Kalibbala
Copy link

Noor-Kalibbala commented Apr 9, 2021

the snippet below

async def _ws_send_str(self, client, string):
    if client.ws._writer.transport.is_closing():
        self.clients.remove(client)
        await client.ws.close()

cause the error below
self.clients.remove(client)
ValueError: list.remove(x): x not in list

@fscherf
Copy link
Contributor

fscherf commented Apr 9, 2021

Hi @Noor-Kalibbala!
Could you try if this snippet solves your problem?

async def _ws_send_str(self, client, string):
    if client.ws._writer.transport.is_closing():
        if client in self.clients:
            self.clients.remove(client)

        await client.ws.close()

@Noor-Kalibbala
Copy link
Author

@fscherf this error it randomly happens, anyway u mean i replace the previous snippet with this snippet in package source code

@Noor-Kalibbala
Copy link
Author

@fscherf thanks, it works well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants