Repository navigation
Commit 303ba58
authored
Pythonrc: Don't register PyREPL hooks twice (#26145)
This pull request refactors the naming and usage of exception and
display hooks in the `pythonrc.py` file to better reflect their
association with VS Code integration. It also simplifies the REPL launch
message and updates related tests to use the new hook names.
**Refactoring and renaming for clarity:** * Renamed `my_excepthook` and
`my_displayhook` methods in `REPLHooks` to `vscode_excepthook` and
`vscode_displayhook`, and updated all references and assignments
accordingly in `pythonrc.py`. * Updated test cases in
`test_shell_integration.py` to use the new hook method names
(`vscode_displayhook` and `vscode_excepthook`).
[[1]](diffhunk://#diff-f900183871669133df435002b57b4e9e7b8d57779718d41d65427fccc833172bL49-R49)
[[2]](diffhunk://#diff-f900183871669133df435002b57b4e9e7b8d57779718d41d65427fccc833172bL62-R62)
**Prompt message simplification:** * Simplified the REPL launch message
to dynamically use "Cmd" or "Ctrl" based on the platform, reducing
duplicated code.
Fixes #261461 parent 9edd2b3 commit 303ba58
2 files changed
Lines changed: 9 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
| 40 | + | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | | - | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
59 | | - | |
60 | | - | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments