Closes #862: Fix handling of `-D and -A` options on Python 3.

This commit is contained in:
Georg Brandl
2012-01-29 10:46:39 +01:00
parent a6512317bf
commit b1c5572d8e
2 changed files with 5 additions and 3 deletions

View File

@@ -22,6 +22,8 @@ Release 1.1.3 (in development)
* #864: Fix crash with some settings of :confval:`modindex_common_prefix`.
* #862: Fix handling of ``-D`` and ``-A`` options on Python 3.
Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway!
======================================================================

View File

@@ -22,7 +22,7 @@ from sphinx.errors import SphinxError
from sphinx.application import Sphinx
from sphinx.util import Tee, format_exception_cut_frames, save_traceback
from sphinx.util.console import red, nocolor, color_terminal
from sphinx.util.pycompat import terminal_safe
from sphinx.util.pycompat import terminal_safe, bytes
def usage(argv, msg=None):
@@ -137,7 +137,7 @@ def main(argv):
try:
val = int(val)
except ValueError:
if likely_encoding:
if likely_encoding and isinstance(val, bytes):
try:
val = val.decode(likely_encoding)
except UnicodeError:
@@ -153,7 +153,7 @@ def main(argv):
try:
val = int(val)
except ValueError:
if likely_encoding:
if likely_encoding and isinstance(val, bytes):
try:
val = val.decode(likely_encoding)
except UnicodeError: