Skip to content

Commit

Permalink
updated format strings to fstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
marksmayo committed Jan 22, 2023
1 parent 07a516c commit 779fe9b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
Binary file added .pymon
Binary file not shown.
2 changes: 1 addition & 1 deletion isort/deprecated/finders.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def find(self, module_name: str) -> Optional[str]:
# Ensure all forced_separate patterns will match to end of string
path_glob = forced_separate
if not forced_separate.endswith("*"):
path_glob = "%s*" % forced_separate
path_glob = f"{forced_separate}*"

if fnmatch(module_name, path_glob) or fnmatch(module_name, "." + path_glob):
return forced_separate
Expand Down
2 changes: 1 addition & 1 deletion isort/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def _preconvert(item: Any) -> Union[str, List[Any]]:
return str(item)
if callable(item) and hasattr(item, "__name__"):
return str(item.__name__)
raise TypeError("Unserializable object {} of type {}".format(item, type(item)))
raise TypeError(f"Unserializable object {item} of type {type(item)}")


def identify_imports_main(
Expand Down
2 changes: 1 addition & 1 deletion isort/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _forced_separate(name: str, config: Config) -> Optional[Tuple[str, str]]:
# Ensure all forced_separate patterns will match to end of string
path_glob = forced_separate
if not forced_separate.endswith("*"):
path_glob = "%s*" % forced_separate
path_glob = f"{forced_separate}*"

if fnmatch(name, path_glob) or fnmatch(name, "." + path_glob):
return (forced_separate, f"Matched forced_separate ({forced_separate}) config value.")
Expand Down
2 changes: 1 addition & 1 deletion isort/setuptools_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def distribution_files(self) -> Iterator[str]:

if self.distribution.py_modules:
for filename in self.distribution.py_modules:
yield "%s.py" % filename
yield f"{filename}.py"
# Don't miss the setup.py file itself
yield "setup.py"

Expand Down

0 comments on commit 779fe9b

Please sign in to comment.