From fb45e33c280bbb9f5b34e04ce2e05012c2be0a7f Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 6 May 2015 20:37:03 +0100 Subject: [PATCH] ./manage.py deleterevisions fails on Py3 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 --- src/reversion/management/commands/deleterevisions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/reversion/management/commands/deleterevisions.py b/src/reversion/management/commands/deleterevisions.py index 984961d9..009ba01a 100644 --- a/src/reversion/management/commands/deleterevisions.py +++ b/src/reversion/management/commands/deleterevisions.py @@ -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.") @@ -212,4 +216,4 @@ def handle(self, *app_labels, **options): for item in revision_query: item.delete() - print("Done") \ No newline at end of file + print("Done")