summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Killen <jason.killen@windsorcircle.com>2015-01-08 17:02:16 -0500
committerIan Lee <IanLee1521@gmail.com>2015-02-01 13:21:28 -0800
commit57372c68833368ed9a999da3a4f186312e880639 (patch)
tree90e496a1fb624e70e27f81e9da515d10d3e11045
parentbcd5d2bae39bc2b43c02f394fea9950f40099199 (diff)
downloadpep8-57372c68833368ed9a999da3a4f186312e880639.tar.gz
#368 don't search the direcotry tree if config was defined with --config
-rwxr-xr-xpep8.py19
1 files 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):