Skip to content

Make raw_input available on Python 3#1

Open
homeworkprod wants to merge 1 commit intokcoyner:masterfrom
homeworkprod-forks:raw-input-fix
Open

Make raw_input available on Python 3#1
homeworkprod wants to merge 1 commit intokcoyner:masterfrom
homeworkprod-forks:raw-input-fix

Conversation

@homeworkprod
Copy link

If the replacement string is empty, a prompt should be shown that asks the user to confirm the deletion of text:

$ python3 rpl 'foo' '' .
Really DELETE all occurences of def (case sensitive)? (Y/[N])

On Python 3, this fails:

Traceback (most recent call last):
  File "rpl", line 314, in <module>
    main()
  File "rpl", line 172, in main
    line = raw_input()
NameError: name 'raw_input' is not defined

Python 2.x's raw_input is available on Python 3.x as input (it had been renamed).
To fix the issue, I have attached a patch that provides input as raw_input, too.

The built-in function had been renamed for Python 3.
@YoranBrondsema
Copy link

👍 to get this merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants