Skip to content

Commit 57372c6

Browse files
Jason KillenIanLee1521
authored andcommitted
#368 don't search the direcotry tree if config was defined with --config
1 parent bcd5d2b commit 57372c6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pep8.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,15 +1934,16 @@ def read_config(options, args, arglist, parser):
19341934
print('user configuration: %s' % user_conf)
19351935
config.read(user_conf)
19361936

1937-
local_dir = os.curdir
1938-
parent = tail = args and os.path.abspath(os.path.commonprefix(args))
1939-
while tail:
1940-
if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]):
1941-
local_dir = parent
1942-
if options.verbose:
1943-
print('local configuration: in %s' % parent)
1944-
break
1945-
(parent, tail) = os.path.split(parent)
1937+
else:
1938+
local_dir = os.curdir
1939+
parent = tail = args and os.path.abspath(os.path.commonprefix(args))
1940+
while tail:
1941+
if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]):
1942+
local_dir = parent
1943+
if options.verbose:
1944+
print('local configuration: in %s' % parent)
1945+
break
1946+
(parent, tail) = os.path.split(parent)
19461947

19471948
pep8_section = parser.prog
19481949
if config.has_section(pep8_section):

0 commit comments

Comments
 (0)