Skip to content

Commit 79d1d39

Browse files
authored
Fixes jazzband#99 by replacing raw_input with input
added (propably obsolete) backwards compatability as django already threw out six
1 parent a04933e commit 79d1d39

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
14+
1415
ALWAYS_ASK, FILES_TO_DATABASE, DATABASE_TO_FILES = ('0', '1', '2')
1516

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

0 commit comments

Comments
 (0)