mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #862: Fix handling of `-D and -A` options on Python 3.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -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!
|
||||
======================================================================
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user