What Python exception does 'OSError: [Errno 98] Address already in use' cause

I’m writing a basic Python TCP socket server. I want to catch the specific exception listed above, what do I need to put after except to do that?

>Solution :

Its the OSError, so you need to catch OSError:

except OSError as error:

Leave a Reply