Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make raw_input available on Python 3 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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