mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactoring: Drop PY2 and PY3 flags
This commit is contained in:
@@ -13,7 +13,7 @@ import sys
|
||||
import time
|
||||
|
||||
import pytest
|
||||
from six import PY2, text_type, StringIO
|
||||
from six import text_type, StringIO
|
||||
from six.moves import input
|
||||
|
||||
from sphinx import application
|
||||
@@ -37,12 +37,7 @@ def mock_input(answers, needanswer=False):
|
||||
raise AssertionError('answer for %r missing and no default '
|
||||
'present' % prompt)
|
||||
called.add(prompt)
|
||||
if PY2:
|
||||
prompt = str(prompt) # Python2.x raw_input emulation
|
||||
# `raw_input` encode `prompt` by default encoding to print.
|
||||
else:
|
||||
prompt = text_type(prompt) # Python3.x input emulation
|
||||
# `input` decode prompt by default encoding before print.
|
||||
prompt = text_type(prompt)
|
||||
for question in answers:
|
||||
if prompt.startswith(qs.PROMPT_PREFIX + question):
|
||||
return answers[question]
|
||||
|
||||
Reference in New Issue
Block a user