From: Keir Fraser Date: Wed, 16 Dec 2009 12:20:57 +0000 (+0000) Subject: pygrub: fix attribute error when not found parser X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12895 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7cafc0777f620a62827e0076dfa32be49603f4da;p=xen.git pygrub: fix attribute error when not found parser Signed-off-by: Wei Kong --- 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()