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

Fix small bug after https://github.com/pytorch-labs/torchfix/pull/46 #52

Merged
merged 1 commit into from
Apr 24, 2024
Merged
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
3 changes: 1 addition & 2 deletions torchfix/visitors/deprecated_symbols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class TorchDeprecatedSymbolsVisitor(TorchVisitor):
ERRORS: List[TorchError] = [
TorchError("TOR001", "Use of removed function {qualified_name}"),
TorchError("TOR101", "Import of deprecated function {qualified_name}"),
TorchError("TOR101", "Use of deprecated function {qualified_name}"),
TorchError("TOR004", "Import of removed function {qualified_name}"),
TorchError("TOR103", "Import of deprecated function {qualified_name}"),
]
Expand Down Expand Up @@ -94,7 +94,6 @@ def visit_Call(self, node) -> None:
if self.deprecated_config[qualified_name]["remove_pr"] is None:
error_code = self.ERRORS[1].error_code
message = self.ERRORS[1].message(qualified_name=qualified_name)
message = f"Use of deprecated function {qualified_name}"
else:
error_code = self.ERRORS[0].error_code
message = self.ERRORS[0].message(qualified_name=qualified_name)
Expand Down