From 3cde3fb39489e8e9b4319d69031f27a2d113cc39 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 14 Feb 2015 11:26:46 +0100 Subject: Clean up unused variables and imports * remove unused imports * remove unused variables * replace unused variables with 'dummy', this is the suggested and most common way to deal with variables that need to be defined but are never used and it also makes pylint not to complain, eg: for root, dir, files in os.walk(directory): for basename in files: if fnmatch.fnmatch(basename, '*.pro'): filename = os.path.join(root, basename) since 'dirs' is never used, we replace it with 'dummy' for root, dummy, files in os.walk(directory): for basename in files: if fnmatch.fnmatch(basename, '*.pro'): filename = os.path.join(root, basename) Change-Id: I850c2c2a8ae60035d0cc5bf6c3429ff8640f9f11 Reviewed-by: Tim Jenssen --- packaging-tools/swap_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packaging-tools/swap_repository.py') diff --git a/packaging-tools/swap_repository.py b/packaging-tools/swap_repository.py index ad9572e85..1289afb6d 100644 --- a/packaging-tools/swap_repository.py +++ b/packaging-tools/swap_repository.py @@ -86,7 +86,7 @@ def parse_cmd_line_args(): ############################### def get_directory_list(base_dir, search_match): matches = [] - for root, dirs, files in os.walk(base_dir): + for root, dirs, dummy in os.walk(base_dir): for basename in dirs: if basename == search_match: fulldirname = os.path.join(root, basename) -- cgit v1.2.3