Loading django/db/migrations/questioner.py +8 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ import os import sys from django.apps import apps from django.utils import datetime_safe from django.utils import datetime_safe, six from django.utils.six.moves import input from .loader import MIGRATIONS_MODULE_NAME Loading Loading @@ -97,6 +97,12 @@ class InteractiveMigrationQuestioner(MigrationQuestioner): print("Please enter the default value now, as valid Python") print("The datetime module is available, so you can do e.g. datetime.date.today()") while True: if six.PY3: # Six does not correctly abstract over the fact that # py3 input returns a unicode string, while py2 raw_input # returns a bytestring. code = input(">>> ") else: code = input(">>> ").decode(sys.stdin.encoding) if not code: print("Please enter some code, or 'exit' (with no quotes) to exit.") Loading Loading
django/db/migrations/questioner.py +8 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ import os import sys from django.apps import apps from django.utils import datetime_safe from django.utils import datetime_safe, six from django.utils.six.moves import input from .loader import MIGRATIONS_MODULE_NAME Loading Loading @@ -97,6 +97,12 @@ class InteractiveMigrationQuestioner(MigrationQuestioner): print("Please enter the default value now, as valid Python") print("The datetime module is available, so you can do e.g. datetime.date.today()") while True: if six.PY3: # Six does not correctly abstract over the fact that # py3 input returns a unicode string, while py2 raw_input # returns a bytestring. code = input(">>> ") else: code = input(">>> ").decode(sys.stdin.encoding) if not code: print("Please enter some code, or 'exit' (with no quotes) to exit.") Loading