1
1
import io
2
2
import os
3
+ import sys
3
4
from django .contrib .sites .models import Site
4
5
from django .core .management .base import CommandError , BaseCommand
5
6
from django .template .utils import get_app_template_dirs
6
7
from django .template .loader import _engine_list
7
- try :
8
- from django .utils .six import input as raw_input
9
- except ImportError :
10
- pass
11
8
12
9
from dbtemplates .models import Template
13
10
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
+
14
15
ALWAYS_ASK , FILES_TO_DATABASE , DATABASE_TO_FILES = ('0' , '1' , '2' )
15
16
16
17
DIRS = []
@@ -83,7 +84,7 @@ def handle(self, **options):
83
84
t = Template .on_site .get (name__exact = name )
84
85
except Template .DoesNotExist :
85
86
if not force :
86
- confirm = raw_input (
87
+ confirm = input (
87
88
"\n A '%s' template doesn't exist in the "
88
89
"database.\n Create it with '%s'?"
89
90
" (y/[n]): " "" % (name , path ))
@@ -95,7 +96,7 @@ def handle(self, **options):
95
96
else :
96
97
while 1 :
97
98
if overwrite == ALWAYS_ASK :
98
- confirm = raw_input (
99
+ confirm = input (
99
100
"\n %(template)s exists in the database.\n "
100
101
"(1) Overwrite %(template)s with '%(path)s'\n "
101
102
"(2) Overwrite '%(path)s' with %(template)s\n "
0 commit comments