macOS: Fix a regression that broke connecting to devices

This commit is contained in:
Kovid Goyal 2020-09-25 14:10:54 +05:30
parent 99680529d3
commit ea2b8922cc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -114,7 +114,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
drives = pprint.pformat(Device.osx_get_usb_drives()) drives = pprint.pformat(Device.osx_get_usb_drives())
ioreg = 'Output from mount:\n'+mount+'\n\n' ioreg = 'Output from mount:\n'+mount+'\n\n'
ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n' ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n'
ioreg += Device.run_ioreg() ioreg += Device.run_ioreg().decode('utf-8')
connected_devices = [] connected_devices = []
if disabled_plugins: if disabled_plugins:
out('\nDisabled plugins:', textwrap.fill(' '.join([x.__class__.__name__ for x in out('\nDisabled plugins:', textwrap.fill(' '.join([x.__class__.__name__ for x in
@ -180,7 +180,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
ioreg = 'IOREG Output\n'+ioreg ioreg = 'IOREG Output\n'+ioreg
out(' ') out(' ')
if ioreg_to_tmp: if ioreg_to_tmp:
lopen('/tmp/ioreg.txt', 'wb').write(ioreg) lopen('/tmp/ioreg.txt', 'w').write(ioreg)
out('Dont forget to send the contents of /tmp/ioreg.txt') out('Dont forget to send the contents of /tmp/ioreg.txt')
out('You can open it with the command: open /tmp/ioreg.txt') out('You can open it with the command: open /tmp/ioreg.txt')
else: else:

View File

@ -280,7 +280,7 @@ usbobserver_get_mounted_filesystems(PyObject *self, PyObject *args) {
if (ans == NULL) { goto end; } if (ans == NULL) { goto end; }
for (i = 0 ; i < num; i++) { for (i = 0 ; i < num; i++) {
val = PyBytes_FromString(buf[i].f_mntonname); val = PyUnicode_FromString(buf[i].f_mntonname);
if (!val) { NUKE(ans); goto end; } if (!val) { NUKE(ans); goto end; }
if (PyDict_SetItemString(ans, buf[i].f_mntfromname, val) != 0) { NUKE(ans); NUKE(val); goto end; } if (PyDict_SetItemString(ans, buf[i].f_mntfromname, val) != 0) { NUKE(ans); NUKE(val); goto end; }
NUKE(val); NUKE(val);