diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-08 19:08:05 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-08 19:53:11 +0200 |
| commit | b8e49d70f2bbbb9008dbbf9d8b0dee46dcf25fa6 (patch) | |
| tree | 03dc8a308b318573351616c42f4c74d370f6ffea /django/db | |
| parent | b1517a310a0a9aa416bc479397d5a7b402be64e2 (diff) | |
[py3] Replaced raw_input by input
The six addition has been borrowed from:
https://bitbucket.org/gutworth/six/changeset/733ef740
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/backends/creation.py | 3 | ||||
| -rw-r--r-- | django/db/backends/oracle/creation.py | 5 | ||||
| -rw-r--r-- | django/db/backends/sqlite3/creation.py | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/django/db/backends/creation.py b/django/db/backends/creation.py index fcc6ab7584..6ac55eb5ff 100644 --- a/django/db/backends/creation.py +++ b/django/db/backends/creation.py @@ -3,6 +3,7 @@ import time from django.conf import settings from django.db.utils import load_backend +from django.utils.six.moves import input # The prefix to put on the default database name when creating # the test database. @@ -330,7 +331,7 @@ class BaseDatabaseCreation(object): sys.stderr.write( "Got an error creating the test database: %s\n" % e) if not autoclobber: - confirm = raw_input( + confirm = input( "Type 'yes' if you would like to try deleting the test " "database '%s', or 'no' to cancel: " % test_database_name) if autoclobber or confirm == 'yes': diff --git a/django/db/backends/oracle/creation.py b/django/db/backends/oracle/creation.py index 2f096f735a..d9bf3dfea2 100644 --- a/django/db/backends/oracle/creation.py +++ b/django/db/backends/oracle/creation.py @@ -1,6 +1,7 @@ import sys import time from django.db.backends.creation import BaseDatabaseCreation +from django.utils.six.moves import input TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' @@ -65,7 +66,7 @@ class DatabaseCreation(BaseDatabaseCreation): except Exception as e: sys.stderr.write("Got an error creating the test database: %s\n" % e) if not autoclobber: - confirm = raw_input("It appears the test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_NAME) + confirm = input("It appears the test database, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_NAME) if autoclobber or confirm == 'yes': try: if verbosity >= 1: @@ -87,7 +88,7 @@ class DatabaseCreation(BaseDatabaseCreation): except Exception as e: sys.stderr.write("Got an error creating the test user: %s\n" % e) if not autoclobber: - confirm = raw_input("It appears the test user, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_USER) + confirm = input("It appears the test user, %s, already exists. Type 'yes' to delete it, or 'no' to cancel: " % TEST_USER) if autoclobber or confirm == 'yes': try: if verbosity >= 1: diff --git a/django/db/backends/sqlite3/creation.py b/django/db/backends/sqlite3/creation.py index efdc457be0..c022b56c85 100644 --- a/django/db/backends/sqlite3/creation.py +++ b/django/db/backends/sqlite3/creation.py @@ -1,6 +1,7 @@ import os import sys from django.db.backends.creation import BaseDatabaseCreation +from django.utils.six.moves import input class DatabaseCreation(BaseDatabaseCreation): # SQLite doesn't actually support most of these types, but it "does the right @@ -53,7 +54,7 @@ class DatabaseCreation(BaseDatabaseCreation): print("Destroying old test database '%s'..." % self.connection.alias) if os.access(test_database_name, os.F_OK): if not autoclobber: - confirm = raw_input("Type 'yes' if you would like to try deleting the test database '%s', or 'no' to cancel: " % test_database_name) + confirm = input("Type 'yes' if you would like to try deleting the test database '%s', or 'no' to cancel: " % test_database_name) if autoclobber or confirm == 'yes': try: os.remove(test_database_name) |
