diff options
author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-04-29 11:46:47 +0900 |
---|---|---|
committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-04-29 11:46:47 +0900 |
commit | 68290a266cea33cf0b60bed425b5e89d1032e7d1 (patch) | |
tree | 629a54150044a6d588bcf8e740e13d65c50178ee /sphinx/cmdline.py | |
parent | 1e4b390b226c856d8c80d1d9857696b7fbcd2580 (diff) | |
download | sphinx-git-68290a266cea33cf0b60bed425b5e89d1032e7d1.tar.gz |
introduce the six module and reduce sphinx.util.pycompat implementation. refs #1350.
Diffstat (limited to 'sphinx/cmdline.py')
-rw-r--r-- | sphinx/cmdline.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py index 07551e67e..377f2385e 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -16,6 +16,7 @@ import getopt import traceback from os import path +import six from docutils.utils import SystemMessage from sphinx import __version__ @@ -24,7 +25,7 @@ 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.osutil import abspath, fs_encoding -from sphinx.util.pycompat import terminal_safe, bytes +from sphinx.util.pycompat import terminal_safe def usage(argv, msg=None): @@ -183,7 +184,7 @@ def main(argv): print('Error: -D option argument must be in the form name=value.', file=sys.stderr) return 1 - if likely_encoding and isinstance(val, bytes): + if likely_encoding and isinstance(val, six.binary_type): try: val = val.decode(likely_encoding) except UnicodeError: @@ -199,7 +200,7 @@ def main(argv): try: val = int(val) except ValueError: - if likely_encoding and isinstance(val, bytes): + if likely_encoding and isinstance(val, six.binary_type): try: val = val.decode(likely_encoding) except UnicodeError: |