replace raw_input with input from six.moves

This commit is contained in:
Johnny Robeson 2016-06-20 01:37:17 -04:00
parent 4649226b9b
commit 1f8e08d168
3 changed files with 6 additions and 4 deletions

View file

@ -31,6 +31,7 @@ import re
import struct
import traceback
import os.path
from six.moves import input
from beets import logging
from beets import library
@ -193,7 +194,7 @@ def should_move(move_opt=None):
# Input prompts.
def input_(prompt=None):
"""Like `raw_input`, but decodes the result to a Unicode string.
"""Like `input`, but decodes the result to a Unicode string.
Raises a UserError if stdin is not available. The prompt is sent to
stdout rather than stderr. A printed between the prompt and the
input cursor.
@ -205,7 +206,7 @@ def input_(prompt=None):
print_(prompt, end=' ')
try:
resp = raw_input()
resp = input()
except EOFError:
raise UserError(u'stdin stream ended while input required')

View file

@ -18,6 +18,7 @@
from __future__ import division, absolute_import, print_function
import time
from six.moves import input
from beets import ui
from beets.plugins import BeetsPlugin
@ -31,7 +32,7 @@ def bpm(max_strokes):
dt = []
for i in range(max_strokes):
# Press enter to the rhythm...
s = raw_input()
s = input()
if s == '':
t1 = time.time()
# Only start measuring at the second stroke

View file

@ -289,7 +289,7 @@ Also note that beets may take some time to quit after ^C is typed; it
tries to clean up after itself briefly even when canceled.
(For developers: this is because the UI thread is blocking on
``raw_input`` and cannot be interrupted by the main thread, which is
``input`` and cannot be interrupted by the main thread, which is
trying to close all pipeline stages in the exception handler by setting
a flag. There is no simple way to remedy this.)