Visitar URL original
gh-105069: Add a readline-like callable to the tokenizer to consume input iteratively by pablogsal · Pull Request #105070 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup! gh-105069: Add a readline-like callable to the tokenizer to co…
…nsume input iteratively
  • Loading branch information
pablogsal committed May 29, 2023
commit 8903d0d1c728a51d64ce12d1ee902e708e32d456
2 changes: 1 addition & 1 deletion Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ def _signature_strip_non_python_syntax(signature):
add(string)
if (string == ','):
add(' ')
clean_signature = ''.join(text).strip().replace('\n', '')
clean_signature = ''.join(text).strip()
return clean_signature, self_parameter


Expand Down
2 changes: 1 addition & 1 deletion Parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ tok_underflow_file(struct tok_state *tok, int use_readline) {
tok->done = E_EOF;
return 0;
}
if (tok->inp[-1] != '\n') {
if (tok->readline == NULL && tok->inp[-1] != '\n') {
assert(tok->inp + 1 < tok->end);
/* Last line does not end in \n, fake one */
*tok->inp++ = '\n';
Expand Down