aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--BluetoothPairedDevices.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/BluetoothPairedDevices.py b/BluetoothPairedDevices.py
index 8e87c3d..6f9f673 100644
--- a/BluetoothPairedDevices.py
+++ b/BluetoothPairedDevices.py
@@ -17,9 +17,12 @@ def ParrotZikMac():
fd = open("/Library/Preferences/com.apple.Bluetooth.plist", "rb")
plist = binplist.BinaryPlist(file_obj=fd)
parsed_plist = plist.Parse()
- for mac in parsed_plist['PairedDevices']:
- if p.match(mac.replace("-",":")):
- return mac.replace("-",":")
+ try :
+ for mac in parsed_plist['PairedDevices']:
+ if p.match(mac.replace("-",":")):
+ return mac.replace("-",":")
+ except:
+ pass
elif sys.platform == "win32":
aReg = _winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE)