aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Moiseev <m0sia@m0sia.ru>2014-01-08 01:56:33 -0800
committerDmitry Moiseev <m0sia@m0sia.ru>2014-01-08 01:56:33 -0800
commit5be0b8a535f5aaffef7da65b03aafe03c4f06351 (patch)
tree837145071e91c9f893a16df862482b0fe1d9acba
parent9afe09f095d83d9ce9c8fa170771e84d9969db23 (diff)
downloadpyParrotZikTCP-5be0b8a535f5aaffef7da65b03aafe03c4f06351.tar.xz
pyParrotZikTCP-5be0b8a535f5aaffef7da65b03aafe03c4f06351.zip
Fix mac adress search on mac os x
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)