--- _lightblue.py 2008-05-13 14:44:26.000000000 -0700 +++ _lightblue_new.py 2008-05-13 14:44:00.000000000 -0700 @@ -23,7 +23,7 @@ try: import bluetooth # pybluez module - import _bluetooth # pybluez internal implementation module + import bluetooth._bluetooth # pybluez internal implementation module except ImportError, e: raise ImportError("LightBlue requires PyBluez to be installed, " + \ "cannot find PyBluez 'bluetooth' module: " + str(e)) @@ -155,9 +155,9 @@ # access _sock._sock (i.e. pybluez socket's internal sock) # this is so we can raise timeout errors with a different exception conn, addr = self._sock._sock.accept() - except _bluetooth.error, e: + except bluetooth._bluetooth.error, e: raise _socket.error(str(e)) - except _bluetooth.timeout, te: + except bluetooth._bluetooth.timeout, te: raise _socket.timeout(str(te)) # return new _SocketWrapper that wraps a new BluetoothSocket @@ -183,9 +183,9 @@ _methoddef = """def %s(self, *args, **kwargs): try: return self._sock._sock.%s(*args, **kwargs) - except _bluetooth.error, e: + except bluetooth._bluetooth.error, e: raise _socket.error(str(e)) - except _bluetooth.timeout, te: + except bluetooth._bluetooth.timeout, te: raise _socket.timeout(str(te)) %s.__doc__ = _lightbluecommon._socketdocs['%s']\n""" for _m in ("connect", "send", "recv"): @@ -198,7 +198,7 @@ _methoddef = """def %s(self, *args, **kwargs): try: return self._sock.%s(*args, **kwargs) - except _bluetooth.error, e: + except bluetooth._bluetooth.error, e: raise _socket.error(str(e)) %s.__doc__ = _lightbluecommon._socketdocs['%s']\n""" for _m in _othermethods: @@ -358,7 +358,7 @@ # Gets HCI socket thru PyBluez. Remember to close the returned socket. def _gethcisock(devid=-1): try: - sock = _bluetooth.hci_open_dev(devid) + sock = bluetooth._bluetooth.hci_open_dev(devid) except Exception, e: raise _lightbluecommon.BluetoothError( "Cannot access local device: " + str(e))