Commit b8c9acf
committed
Improve user_input's input/raw_input compatibility.
This PR add the changes from #723 with the necessary rebase.
Quoting the PR comment:
I didn't like having to add a prompt message when using python's
input and running it with PymodeRun
* Allow default prompt ('' empty string)
* Fix quoting (input('"') would crash because it wasn't escaped)
* Strip whitespace to avoid duplicate spaces
Caveats:
strips all leading and trailing whitespace from prefix and msg still
doesn't write the prompt to stdout like input/raw_input does (to fix
that one would need a separate function for replacing
input/raw_input)
Close 7231 parent 1ce5ce3 commit b8c9acf
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 106 | + | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| |||
0 commit comments