From 256d04c35bdd166aaf7bc46d93bb9246cd064bb7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 1 Sep 2010 08:37:11 -0700 Subject: [PATCH] In ensure_dirs(), only call apply_permissions() when keyword arguments for it are given. --- pym/portage/util/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 2c22949a4..b11222d00 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -1042,7 +1042,7 @@ def write_atomic(file_path, content, **kwargs): else: raise -def ensure_dirs(dir_path, *args, **kwargs): +def ensure_dirs(dir_path, **kwargs): """Create a directory and call apply_permissions. Returns True if a directory is created or the permissions needed to be modified, and False otherwise.""" @@ -1070,7 +1070,10 @@ def ensure_dirs(dir_path, *args, **kwargs): raise ReadOnlyFileSystem(func_call) else: raise - perms_modified = apply_permissions(dir_path, *args, **kwargs) + if kwargs: + perms_modified = apply_permissions(dir_path, **kwargs) + else: + perms_modified = False return created_dir or perms_modified class LazyItemsDict(UserDict): -- 2.26.2