From ba78eb2d849bb5cac37793fe547861359ec0b6be Mon Sep 17 00:00:00 2001 From: Hongxin Liang Date: Thu, 19 Dec 2019 13:48:47 +0100 Subject: [PATCH] explicitly check for first-party modules under pwd could be identified as first-party instead of default configuration --- isort/finders.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isort/finders.py b/isort/finders.py index 259ddbb48..e9b919a14 100644 --- a/isort/finders.py +++ b/isort/finders.py @@ -187,6 +187,8 @@ def find(self, module_name: str) -> Optional[str]: return sections.THIRDPARTY if os.path.normcase(prefix).startswith(self.stdlib_lib_prefix): return sections.STDLIB + if os.getcwd() in package_path: + return sections.FIRSTPARTY return self.config.default_section return None