From 7cafc0777f620a62827e0076dfa32be49603f4da Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 16 Dec 2009 12:20:57 +0000 Subject: pygrub: fix attribute error when not found parser Signed-off-by: Wei Kong --- tools/pygrub/src/pygrub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/pygrub') diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index d77fee77d1..c2870853c2 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -397,7 +397,7 @@ class Grub: self.cf = parser() self.cf.filename = f break - if self.cf.filename is None: + if self.__dict__.get('cf', None) is None: raise RuntimeError, "couldn't find bootloader config file in the image provided." f = fs.open_file(self.cf.filename) buf = f.read() -- cgit v1.2.3