Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 5638505649857546158ae504da2a4b25 > files > 13

bootchart-0.14.0-1.2.git20110331.fc15.src.rpm

From 079396d64fd3ac5a399b46e7a41b5f4924a82699 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 18 Feb 2011 14:05:34 +0100
Subject: [PATCH] pybootchartgui/main.py.in: catch IOError and print error message

---
 pybootchartgui/main.py.in |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pybootchartgui/main.py.in b/pybootchartgui/main.py.in
index cd5f273..810af12 100644
--- a/pybootchartgui/main.py.in
+++ b/pybootchartgui/main.py.in
@@ -144,6 +144,9 @@ def main(argv=None):
 				finally:
 					f.close()
 			filename = _get_filename(args, options)
+			if not os.access(filename, os.W_OK):
+				print("Can't write to %s" % filename);
+				return 2
 			def render():
 				batch.render(writer, res, options, filename)
 			if options.profile: