Skip to content

Commit

Permalink
tokenize no longer accepts \0 bytes in source code in 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Aug 16, 2023
1 parent 58b7117 commit f8390e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/twisted/persisted/aot.py
Expand Up @@ -231,13 +231,17 @@ def indentify(s):
out = []
stack = []
l = ["", s]

def readline():
return l.pop().replace("\0", "")

for (
tokenType,
tokenString,
(startRow, startColumn),
(endRow, endColumn),
logicalLine,
) in tokenize(l.pop):
) in tokenize(readline):
if tokenString in ["[", "(", "{"]:
stack.append(tokenString)
elif tokenString in ["]", ")", "}"]:
Expand Down

0 comments on commit f8390e3

Please sign in to comment.