Pithikos / python-websocket-server

A simple fully working websocket-server in Python with no external dependencies
MIT License
1.14k stars 381 forks source link

python 2.7 crashes handling error ConnectionResetError #43

Closed charlielito closed 6 years ago

charlielito commented 6 years ago

Hi! I was running the server in python 2.7 but it crashed when it tried to handle the ConnectionResetError, because I think it is not defined in python 2.7. I'm proposing this fix, although I dont know if there's a better way to do it.

Pithikos commented 6 years ago

Thanks charlielito. It might be worth putting a comment in the code about this - mentioning that ConnectionResetError should be used instead in the future. Since in less than 2 years Python2 will not be supported anyway so it will make it easier to remove any Python2 specific code.