diff options
author | Dmitry Moiseev <m0sia@m0sia.ru> | 2014-01-08 01:56:33 -0800 |
---|---|---|
committer | Dmitry Moiseev <m0sia@m0sia.ru> | 2014-01-08 01:56:33 -0800 |
commit | 5be0b8a535f5aaffef7da65b03aafe03c4f06351 (patch) | |
tree | 837145071e91c9f893a16df862482b0fe1d9acba | |
parent | 9afe09f095d83d9ce9c8fa170771e84d9969db23 (diff) | |
download | pyParrotZikTCP-5be0b8a535f5aaffef7da65b03aafe03c4f06351.tar.xz pyParrotZikTCP-5be0b8a535f5aaffef7da65b03aafe03c4f06351.zip |
Fix mac adress search on mac os x
Diffstat (limited to '')
-rw-r--r-- | BluetoothPairedDevices.py | 9 |
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) |