diff options
author | Jason Killen <jason.killen@windsorcircle.com> | 2015-01-08 17:02:16 -0500 |
---|---|---|
committer | Ian Lee <IanLee1521@gmail.com> | 2015-02-01 13:21:28 -0800 |
commit | 57372c68833368ed9a999da3a4f186312e880639 (patch) | |
tree | 90e496a1fb624e70e27f81e9da515d10d3e11045 /pep8.py | |
parent | bcd5d2bae39bc2b43c02f394fea9950f40099199 (diff) | |
download | pep8-57372c68833368ed9a999da3a4f186312e880639.tar.gz |
#368 don't search the direcotry tree if config was defined with --config
Diffstat (limited to 'pep8.py')
-rwxr-xr-x | pep8.py | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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): |