~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Lib/multiprocessing/connection.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
    '''
250
250
    def __init__(self, address, family, backlog=1):
251
251
        self._socket = socket.socket(getattr(socket, family))
252
 
        self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
253
 
        self._socket.bind(address)
254
 
        self._socket.listen(backlog)
255
 
        self._address = self._socket.getsockname()
 
252
        try:
 
253
            self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
 
254
            self._socket.bind(address)
 
255
            self._socket.listen(backlog)
 
256
            self._address = self._socket.getsockname()
 
257
        except socket.error:
 
258
            self._socket.close()
 
259
            raise
256
260
        self._family = family
257
261
        self._last_accepted = None
258
262