Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated format strings to fstrings #2076

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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