Skip to content

Instantly share code, notes, and snippets.

@Wilfred
Last active December 28, 2015 12:29
Show Gist options
  • Select an option

  • Save Wilfred/7501200 to your computer and use it in GitHub Desktop.

Select an option

Save Wilfred/7501200 to your computer and use it in GitHub Desktop.
read_input.py works fine, but read_input_rpython_import.py writes a strange traceback to the console
$ PYTHONPATH=pypy python2 read_input_rpython_import.py
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-2.2.x-41/platcheck_0.c -o /tmp/usession-release-2.2.x-41/platcheck_0.o
[platform:execute] gcc /tmp/usession-release-2.2.x-41/platcheck_0.o -pthread -lintl -lrt -o /tmp/usession-release-2.2.x-41/platcheck_0
> ^C
Traceback (most recent call last):
caught keyboard interrupt
File "/home/wilfred/projects/baobob/pypy/rpython/tool/runsubprocess.py", line 39, in <module>
> operation = sys.stdin.readline()
KeyboardInterrupt
^C
caught keyboard interrupt
> ^C
caught keyboard interrupt
>
import sys
def entry_point(argv):
while True:
try:
user_input = raw_input('> ')
print user_input
except KeyboardInterrupt:
print '\nkeyboard interrupt'
return 0
def target(*args):
return entry_point, None
if __name__ == '__main__':
entry_point(sys.argv)
import sys
from rpython.rlib.rsre import rsre_core
def entry_point(argv):
while True:
try:
user_input = raw_input('> ')
print user_input
except KeyboardInterrupt:
print '\ncaught keyboard interrupt'
return 0
def target(*args):
return entry_point, None
if __name__ == '__main__':
entry_point(sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment