From 80ee47c23347e095acbd19c6fc28eb8e5f46db3c Mon Sep 17 00:00:00 2001 From: Hideo Hattori Date: Fri, 10 Apr 2020 20:09:08 +0900 Subject: [PATCH] enable exclude option when specify directly file args --- autopep8.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/autopep8.py b/autopep8.py index dc2b60d6..00a10784 100755 --- a/autopep8.py +++ b/autopep8.py @@ -4209,7 +4209,13 @@ def find_files(filenames, recursive, exclude): if match_file(os.path.join(root, d), exclude)] else: - yield name + is_exclude_match = False + for pattern in exclude: + if fnmatch.fnmatch(name, pattern): + is_exclude_match = True + break + if not is_exclude_match: + yield name def _fix_file(parameters):