Skip to content

Conversation

@robsdedude
Copy link
Member

@robsdedude robsdedude commented Dec 20, 2023

Python 3.12 changed how f-strings are handled and what they're capable of. It's likely because of this reason that the tokenizer module changed how it handles f-strings as well.

When finding escaped curly brackets in an f-string (e.g., f"{{") the tokenizer will only emit a single curly bracket and pretend the token ended one symbol earlier than the pair of brackets does. This PR basically hot-fixes those tokens to behave in a more consitent way by not swallowing the seconds bracket and by re-writing the token to end where the bracket pair actually ends.

Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@robsdedude robsdedude merged commit a8242c2 into neo4j:5.0 Dec 27, 2023
@robsdedude robsdedude deleted the fix/unasync-script-python-3.12 branch December 27, 2023 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants