Skip to content

Commit

Permalink
Update code to address deepsource errors
Browse files Browse the repository at this point in the history
It complained about an else-return issue[1] and some commented-out code

Link: https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/no-else-return.html [1]
  • Loading branch information
matthewhughes934 committed Dec 8, 2024
1 parent 846b64d commit 6a83152
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion isort/deprecated/finders.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def _load_mapping() -> Optional[Dict[str, str]]:
import_name, _, pypi_name = line.strip().partition(":")
mappings[pypi_name] = import_name
return mappings
# return dict(tuple(line.strip().split(":")[::-1]) for line in f)

def _load_names(self) -> List[str]:
"""Return list of thirdparty modules from requirements"""
Expand Down
3 changes: 1 addition & 2 deletions isort/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ def is_supported_filetype(self, file_name: str) -> bool:
line = fp.readline(100)
except OSError:
return False
else:
return bool(_SHEBANG_RE.match(line))
return bool(_SHEBANG_RE.match(line))

def _check_folder_git_ls_files(self, folder: str) -> Optional[Path]:
env = {**os.environ, "LANG": "C.UTF-8"}
Expand Down

0 comments on commit 6a83152

Please sign in to comment.