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()