Bug #204020 - Make grabfile() properly raise PermissionDenied when
authorZac Medico <zmedico@gentoo.org>
Wed, 2 Jan 2008 15:00:39 +0000 (15:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 Jan 2008 15:00:39 +0000 (15:00 -0000)
appropriate instead of silently ignoring permission errors.

svn path=/main/trunk/; revision=9135

pym/portage/util.py

index 83d3fb430f7777201ee7009d70faf0f24010b123..39abcd81ec0226ab957ea2ca57903cd17bf18c00 100644 (file)
@@ -280,7 +280,9 @@ def grablines(myfilename,recursive=0):
                        myfile = open(myfilename, "r")
                        mylines = myfile.readlines()
                        myfile.close()
-               except IOError:
+               except IOError, e:
+                       if e.errno == PermissionDenied.errno:
+                               raise PermissionDenied(myfilename)
                        pass
        return mylines