From 57372c68833368ed9a999da3a4f186312e880639 Mon Sep 17 00:00:00 2001 From: Jason Killen Date: Thu, 8 Jan 2015 17:02:16 -0500 Subject: #368 don't search the direcotry tree if config was defined with --config --- pep8.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pep8.py b/pep8.py index 79497e2..91b0e95 100755 --- a/pep8.py +++ b/pep8.py @@ -1934,15 +1934,16 @@ def read_config(options, args, arglist, parser): print('user configuration: %s' % user_conf) config.read(user_conf) - local_dir = os.curdir - parent = tail = args and os.path.abspath(os.path.commonprefix(args)) - while tail: - if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]): - local_dir = parent - if options.verbose: - print('local configuration: in %s' % parent) - break - (parent, tail) = os.path.split(parent) + else: + local_dir = os.curdir + parent = tail = args and os.path.abspath(os.path.commonprefix(args)) + while tail: + if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]): + local_dir = parent + if options.verbose: + print('local configuration: in %s' % parent) + break + (parent, tail) = os.path.split(parent) pep8_section = parser.prog if config.has_section(pep8_section): -- cgit v1.2.1