Skip to content

Commit

Permalink
./manage.py deleterevisions fails on Py3
Browse files Browse the repository at this point in the history
Running delete revisions on Python 3.4.0 results in an error:

    choice = raw_input("Are you sure you want to delete theses revisions? [y|N] ")
NameError: name 'raw_input' is not defined
  • Loading branch information
David Smith committed May 6, 2015
1 parent e419121 commit fb45e33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/reversion/management/commands/deleterevisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def handle(self, *app_labels, **options):

# Ask confirmation
if confirmation:
try:
raw_input = raw_input
except NameError:
raw_input = input
choice = raw_input("Are you sure you want to delete theses revisions? [y|N] ")
if choice.lower() != "y":
print("Aborting revision deletion.")
Expand All @@ -212,4 +216,4 @@ def handle(self, *app_labels, **options):
for item in revision_query:
item.delete()

print("Done")
print("Done")

0 comments on commit fb45e33

Please sign in to comment.