For bug #187518, handle EISDIR thrown from mkdir when the directory already exists...
authorZac Medico <zmedico@gentoo.org>
Thu, 2 Aug 2007 17:19:32 +0000 (17:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 2 Aug 2007 17:19:32 +0000 (17:19 -0000)
svn path=/main/branches/2.1.2/; revision=7545

pym/portage_util.py

index d71add57e48b684ac2c4b624c7dfb6e763bfef2a..8e4a8cb44df72bca8a64e5e2a17bbad60cd6c88c 100644 (file)
@@ -852,7 +852,7 @@ def ensure_dirs(dir_path, *args, **kwargs):
                created_dir = True
        except OSError, oe:
                func_call = "makedirs('%s')" % dir_path
-               if errno.EEXIST == oe.errno:
+               if oe.errno in (errno.EEXIST, errno.EISDIR):
                        pass
                elif oe.errno == errno.EPERM:
                        raise OperationNotPermitted(func_call)