Skip to content

Commit ae97ad7

Browse files
authored
Merge pull request jazzband#100 from nschlemm/nschlemm-patch-raw_input
2 parents 5c6c35b + 2301576 commit ae97ad7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dbtemplates/management/commands/sync_templates.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import io
22
import os
3+
import sys
34
from django.contrib.sites.models import Site
45
from django.core.management.base import CommandError, BaseCommand
56
from django.template.utils import get_app_template_dirs
67
from django.template.loader import _engine_list
7-
try:
8-
from django.utils.six import input as raw_input
9-
except ImportError:
10-
pass
118

129
from dbtemplates.models import Template
1310

11+
# (propably obsolete) backwards compatability as django already threw out six
12+
if sys.version_info[0] == 2:
13+
input = raw_input # noqa: F821
14+
1415
ALWAYS_ASK, FILES_TO_DATABASE, DATABASE_TO_FILES = ('0', '1', '2')
1516

1617
DIRS = []
@@ -83,7 +84,7 @@ def handle(self, **options):
8384
t = Template.on_site.get(name__exact=name)
8485
except Template.DoesNotExist:
8586
if not force:
86-
confirm = raw_input(
87+
confirm = input(
8788
"\nA '%s' template doesn't exist in the "
8889
"database.\nCreate it with '%s'?"
8990
" (y/[n]): """ % (name, path))
@@ -95,7 +96,7 @@ def handle(self, **options):
9596
else:
9697
while 1:
9798
if overwrite == ALWAYS_ASK:
98-
confirm = raw_input(
99+
confirm = input(
99100
"\n%(template)s exists in the database.\n"
100101
"(1) Overwrite %(template)s with '%(path)s'\n"
101102
"(2) Overwrite '%(path)s' with %(template)s\n"

0 commit comments

Comments
 (0)