Commit 1e61ef14 authored by Stefan Behnel's avatar Stefan Behnel

make raw_input() usage compatible with Py2/Py3

parent 0ba77ca3
...@@ -4,6 +4,11 @@ GDB extension that adds Cython support. ...@@ -4,6 +4,11 @@ GDB extension that adds Cython support.
from __future__ import print_function from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import sys import sys
import textwrap import textwrap
import traceback import traceback
...@@ -799,7 +804,7 @@ class CyBreak(CythonCommand): ...@@ -799,7 +804,7 @@ class CyBreak(CythonCommand):
while True: while True:
try: try:
result = raw_input( result = input(
"Select a function, press 'a' for all " "Select a function, press 'a' for all "
"functions or press 'q' or '^D' to quit: ") "functions or press 'q' or '^D' to quit: ")
except EOFError: except EOFError:
......
...@@ -45,6 +45,12 @@ the type names are known to the debugger ...@@ -45,6 +45,12 @@ the type names are known to the debugger
The module also extends gdb with some python-specific commands. The module also extends gdb with some python-specific commands.
''' '''
try:
input = raw_input
except NameError:
pass
import os import os
import re import re
import sys import sys
...@@ -2549,7 +2555,7 @@ class PyExec(gdb.Command): ...@@ -2549,7 +2555,7 @@ class PyExec(gdb.Command):
lines = [] lines = []
while True: while True:
try: try:
line = raw_input('>') line = input('>')
except EOFError: except EOFError:
break break
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment