Merge pull request #383 from shinji-s/devel

Stop catching subprocess.CalledProcessError. (No point in re-raising …
pull/402/head
multibootusb 6 years ago committed by GitHub
commit 9750ec67e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -305,7 +305,6 @@ class Linux(Base):
def gpt_device(self, dev_name):
disk_dev = dev_name.rstrip('0123456789')
try:
cmd = ['parted', disk_dev, '-s', 'print']
with open(os.devnull) as devnull:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
@ -316,10 +315,6 @@ class Linux(Base):
lang = os.getenv('LANG')
encoding = lang.rsplit('.')[-1] if lang else 'utf-8'
raise RuntimeError(str(_err_out, encoding))
except subprocess.CalledProcessError as e:
# Control is unlikely to reach here because Popen() is not
# supposed to raise this exception.
raise RuntimeError(str(e))
subprocess.check_call(['partprobe', disk_dev])
if b'msdos' in _cmd_out:
return False

Loading…
Cancel
Save