I have the following code in order to create a socket:

```
#!/usr/bin/python

import socket
import sys

try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
        print 'Failed to create socket. Error code: ' + str(msg[0]) + ' Error message: ' + msg[1]
        sys.exit();
print 'Socket created!'

```

but I have the following error:

```
AttributeError: 'module' object has no attribute 'error'

```