Apply Python 3 futurize transform libmodernize.fixes.fix_input_six.

This commit is contained in:
Tim Abbott 2015-11-01 08:14:42 -08:00
parent 2ea0663a4a
commit 3b185ad4de
2 changed files with 6 additions and 4 deletions

View File

@ -11,6 +11,7 @@ from __future__ import print_function
from __future__ import absolute_import
import sys
import six
from six.moves import input
if sys.hexversion < 0x02040000:
# The limiter is the subprocess module
sys.stderr.write("git-p4: requires Python 2.4 or later.\n")
@ -1213,7 +1214,7 @@ class P4Submit(Command, P4UserMap):
return True
while True:
response = raw_input("Submit template unchanged. Submit anyway? [y]es, [n]o (skip this patch) ")
response = input("Submit template unchanged. Submit anyway? [y]es, [n]o (skip this patch) ")
if response == 'y':
return True
if response == 'n':
@ -1707,7 +1708,7 @@ class P4Submit(Command, P4UserMap):
# prompt for what to do, or use the option/variable
if self.conflict_behavior == "ask":
print("What do you want to do?")
response = raw_input("[s]kip this commit but apply"
response = input("[s]kip this commit but apply"
" the rest, or [q]uit? ")
if not response:
continue

View File

@ -13,6 +13,7 @@ from zerver.models import Realm, get_realm, email_to_username
from zerver.lib.actions import do_create_user
from zerver.views import notify_new_user
from zerver.lib.initial_password import initial_password
from six.moves import input
class Command(BaseCommand):
help = """Create the specified user with a default initial password.
@ -64,13 +65,13 @@ Terms of Service by passing --this-user-has-accepted-the-tos.""")
parameters, or specify no parameters for interactive user creation.""")
else:
while True:
email = raw_input("Email: ")
email = input("Email: ")
try:
validators.validate_email(email)
break
except ValidationError:
print("Invalid email address.", file=sys.stderr)
full_name = raw_input("Full name: ")
full_name = input("Full name: ")
try:
notify_new_user(do_create_user(email, initial_password(email),