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

svn path=/main/branches/2.1.2/; revision=9136

pym/portage_util.py

index db93a042a37967f3dbdae53fabb318e6e3718bc8..486376bfceec0db25ccef8a945bb0e5a5c970ec1 100644 (file)
@@ -266,7 +266,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