Skip to content

Commit

Permalink
Merge branch 'main' into pytokens
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharsadhwani authored Dec 23, 2024
2 parents 1e105f8 + 0aabac4 commit 4dace1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blib2to3/pgen2/pgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ def raise_error(self, msg: str, *args: Any) -> NoReturn:
msg = msg % args
except Exception:
msg = " ".join([msg] + list(map(str, args)))
raise SyntaxError(msg, (self.filename, self.end[0], self.end[1], self.line))
raise SyntaxError(
msg, (str(self.filename), self.end[0], self.end[1], self.line)
)


class NFAState:
Expand Down
17 changes: 17 additions & 0 deletions tests/data/cases/annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# regression test for #1765
class Foo:
def foo(self):
if True:
content_ids: Mapping[
str, Optional[ContentId]
] = self.publisher_content_store.store_config_contents(files)

# output

# regression test for #1765
class Foo:
def foo(self):
if True:
content_ids: Mapping[str, Optional[ContentId]] = (
self.publisher_content_store.store_config_contents(files)
)

0 comments on commit 4dace1a

Please sign in to comment.