Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
sphinx.util.pycompat.bytes not in Sphinx 1.3
Browse files Browse the repository at this point in the history
Replaces this with an explcit Python version check, which is bad,
but there does not appear to be another option.
  • Loading branch information
pao committed May 8, 2015
1 parent 15e0f6f commit 4ea9c64
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions juliadoc/jldoctest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import re
import sys
import time
Expand Down Expand Up @@ -26,7 +25,6 @@
from sphinx.util.nodes import set_source_info
from sphinx.util.compat import Directive
from sphinx.util.console import bold
from sphinx.util.pycompat import bytes
from sphinx.ext.doctest import TestDirective, TestGroup, TestCode, \
TestsetupDirective, TestcleanupDirective, DoctestDirective, \
TestcodeDirective, TestoutputDirective
Expand Down Expand Up @@ -690,7 +688,11 @@ def _warn_out(self, text):
self.info(text, nonl=True)
if self.app.quiet:
self.warn(text)
if isinstance(text, bytes):
if sys.version_info >= (3,0,0):
isbytes = isinstance(text, bytes)
else:
isbytes = isinstance(text, str)
if isbytes:
text = force_decode(text, None)
self.outfile.write(text)

Expand Down

0 comments on commit 4ea9c64

Please sign in to comment.