Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-119842: Honor PyOS_InputHook in the new REPL#119843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 5 commits intopython:mainfrompablogsal:gh-119842
Jun 4, 2024
Merged
Changes from1 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
PrevPrevious commit
Merge branch 'main' intogh-119842
  • Loading branch information
@ambv
ambv authoredJun 4, 2024
commit380f411a5a0f8174a910d5ee9357a14537db20f7
16 changes: 16 additions & 0 deletionsLib/test/test_pyrepl/test_reader.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -196,6 +196,22 @@ def _prepare_console(events):

self.assertEqual(len(input_hook.mock_calls), 4)

def test_keyboard_interrupt_clears_screen(self):
namespace = {"itertools": itertools}
code = "import itertools\nitertools."
events = itertools.chain(code_to_events(code), [
Event(evt='key', data='\t', raw=bytearray(b'\t')), # Two tabs for completion
Event(evt='key', data='\t', raw=bytearray(b'\t')),
Event(evt='key', data='\x03', raw=bytearray(b'\x03')), # Ctrl-C
])

completing_reader = functools.partial(
prepare_reader,
readline_completer=rlcompleter.Completer(namespace).complete
)
reader, _ = handle_all_events(events, prepare_reader=completing_reader)
self.assertEqual(reader.calc_screen(), code.split("\n"))

def test_prompt_length(self):
# Handles simple ASCII prompt
ps1 = ">>> "
Expand Down
You are viewing a condensed version of this merge commit. You can view thefull changes here.

[8]ページ先頭

©2009-2025 Movatter.jp