pythoncode-tutorials icon indicating copy to clipboard operation
pythoncode-tutorials copied to clipboard

Code is unreachable Pylance on Server.py

Open Senophyx opened this issue 3 years ago • 1 comments

https://github.com/x4nth055/pythoncode-tutorials/blob/master/python-standard-library/chat-application/server.py

When I put all the code in server.py into VSCode, it suddenly shows an error Code is unreachable Pylance and it seems because while True: before :

# close client sockets
for cs in client_sockets:
    cs.close()
# close server socket
s.close()

Can you update the code again, I need it :)

Senophyx avatar Nov 22 '21 02:11 Senophyx

Hello @LyQuid12 ,

It's been a while since I wrote that code and I have that warning as well on VSCode, you can simply delete that block of code or leave it as is, it's just a warning and you still can run the code normally.

Hope this helps.

x4nth055 avatar Dec 08 '21 08:12 x4nth055