mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Nicer presentation of mount output
This commit is contained in:
parent
8f6a1e0fdc
commit
6e4a865a25
@ -113,7 +113,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
|
||||
ioreg = None
|
||||
if ismacos:
|
||||
from calibre.devices.usbms.device import Device
|
||||
mount = '\n'.join(repr(x) for x in Device.osx_run_mount().splitlines())
|
||||
mount = Device.osx_run_mount()
|
||||
drives = pprint.pformat(Device.osx_get_usb_drives())
|
||||
ioreg = 'Output from mount:\n'+mount+'\n\n'
|
||||
ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n'
|
||||
|
@ -347,8 +347,7 @@ class Device(DeviceConfig, DevicePlugin):
|
||||
def osx_run_mount(cls):
|
||||
for i in range(3):
|
||||
try:
|
||||
return subprocess.Popen('mount',
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
return subprocess.Popen('mount', stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'replace')
|
||||
except OSError: # Probably an interrupted system call
|
||||
if i == 2:
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user