[Pkg-privacy-commits] [tails-installer] 37/40: Gracefully handle missing paths (#1057640)
anonym
anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:15:03 UTC 2017
This is an automated email from the git hooks/post-receive script.
anonym-tails-guest pushed a commit to annotated tag 3.13.1
in repository tails-installer.
commit 8dfecaa1664a082c046b4ce9042e7ebcc7d4b8b9
Author: Luke Macken <lmacken at redhat.com>
Date: Wed Nov 26 23:38:24 2014 -0700
Gracefully handle missing paths (#1057640)
---
liveusb/creator.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 8a44e80..e679900 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -779,7 +779,10 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
""" Return the number of available bytes on our device """
import statvfs
device = device and device or self.dest
- stat = os.statvfs(device.encode('utf-8'))
+ device = device.encode('utf-8')
+ if not os.path.exists(device):
+ raise LiveUSBError(_('Cannot find device: %s') % device)
+ stat = os.statvfs(device)
return stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL]
def _get_device(self, udi):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list