Commits

Georg Brandl committed 26d0a61

Fix raw_input which is not converted by 2to3 if not called.

Comments (0)

Files changed (2)

 from sphinx.util import texescape
 
 # function to get input from terminal -- overridden by the test suite
-term_input = raw_input
+try:
+    # this raw_input is not converted by 2to3
+    term_input = raw_input
+except NameError:
+    term_input = input
 
 
 PROMPT_PREFIX = '> '
         return _unicode_string_re.sub('\\1', source)
 
     for f in ['QUICKSTART_CONF', 'EPUB_CONFIG', 'INTERSPHINX_CONFIG']:
-        globals()[f] = convert_python_source(globals()[f])
+        globals()[f] = _convert_python_source(globals()[f])
 
     del _unicode_string_re, _convert_python_source
 

tests/test_quickstart.py

         return ''
     return raw_input
 
+try:
+    real_raw_input = raw_input
+except NameError:
+    real_raw_input = input
+
 def teardown_module():
-    qs.term_input = raw_input
+    qs.term_input = real_raw_input
     qs.TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
     coloron()