summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2020-01-12 16:37:25 -0800
committerEric N. Vander Weele <ericvw@gmail.com>2020-01-12 23:13:11 -0500
commite887ef33177b1d7617c6f1cf816e323886863b64 (patch)
tree0fa308bdffd1014d1eb07760474bc4a7c9c76e78 /src
parent98d3d50295c3e686913e4c01ca0de2c523aae33b (diff)
downloadflake8-e887ef33177b1d7617c6f1cf816e323886863b64.tar.gz
config: Remove ConfigFileFinder 'parent' and 'tail' attributes
These attributes are only needed within the `.generate_possible_local_files()` method. Therefore, just obtain the current working directory at the beginning of the method and reduce the lifetime state of the `ConfigFileFinder` object.
Diffstat (limited to 'src')
-rw-r--r--src/flake8/options/config.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py
index 7261bcd..dab16c4 100644
--- a/src/flake8/options/config.py
+++ b/src/flake8/options/config.py
@@ -51,8 +51,6 @@ class ConfigFileFinder(object):
self.local_directory = os.path.abspath(os.curdir)
- self.parent = self.tail = os.getcwd()
-
# caches to avoid double-reading config files
self._local_configs = None
self._local_found_files = [] # type: List[str]
@@ -96,8 +94,7 @@ class ConfigFileFinder(object):
def generate_possible_local_files(self):
"""Find and generate all local config files."""
- tail = self.tail
- parent = self.parent
+ parent = tail = os.getcwd()
found_config_files = False
while tail and not found_config_files:
for project_filename in self.project_filenames: