Skip to content

Commit

Permalink
only check for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dylwil3 committed Dec 3, 2024
1 parent 1754bfe commit afaa319
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/ruff_workspace/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,10 @@ impl<'de> Deserialize<'de> for Alias {
D: Deserializer<'de>,
{
let name = String::deserialize(deserializer)?;
// Assignments to these names are SyntaxErrors
// Assigning to "__debug__" is a SyntaxError
// see the note here:
// https://docs.python.org/3/library/constants.html#debug__
if matches!(&*name, "__debug__" | "True" | "False" | "None") {
if &*name == "__debug__" {
return Err(de::Error::invalid_value(
de::Unexpected::Str(&name),
&"an assignable Python identifier",
Expand Down

0 comments on commit afaa319

Please sign in to comment.