Skip to content

Commit be6ad5c

Browse files
committed
Support raw_input
1 parent 796a5a8 commit be6ad5c

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎Changelog.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Changelog
1111
* Fixed run-time error when output non-ascii in multibyte locale;
1212
* Move initialization into ftplugin as it is python specific;
1313
* Pyrex (Cython) files support;
14+
* Support `raw_input` in run python code;
1415

1516
## 2012-09-07 0.6.10
1617
--------------------

‎autoload/pymode/run.vim‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ fun! pymode#run#Run(line1, line2) "{{{
1515
call pymode#WideMessage("Code running.")
1616
try
1717
call setqflist([])
18-
py execfile(vim.eval('expand("%s:p")'))
18+
py execfile(vim.eval('expand("%s:p")'), {'raw_input': lambda s:
19+
vim.eval('input("{0}")'.format(s)), 'input': vim.eval('input("{0}")'.format(s))})
1920
py out, err = sys.stdout.getvalue().strip(), sys.stderr.getvalue()
2021
py sys.stdout, sys.stderr = stdout_, stderr_
2122

‎pylibs/pymode/lint.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
from .queue import add_task
77

88

9-
locale.setlocale(locale.LC_CTYPE, "C")
9+
try:
10+
locale.setlocale(locale.LC_CTYPE, "C")
11+
except AttributeError:
12+
pass
1013

1114

1215
def check_file():

0 commit comments

Comments
 (0)