Bug #334817 - Make genconfig() warn about EISDIR instead of raising
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Aug 2010 16:52:33 +0000 (09:52 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Aug 2010 16:52:33 +0000 (09:52 -0700)
a IOError.

pym/portage/util/__init__.py

index 279a12137ac5b77790a75e5624db616aed88d736..98ad7c205394787a73c96b00dea39b082c1022c7 100644 (file)
@@ -424,7 +424,8 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
                        raise PermissionDenied(mycfg)
                if e.errno != errno.ENOENT:
                        writemsg("open('%s', 'r'): %s\n" % (mycfg, e), noiselevel=-1)
-                       raise
+                       if e.errno not in (errno.EISDIR,):
+                               raise
                return None
        try:
                if tolerant: