Skip to content

Commit

Permalink
doc: Fix output of version string when using Sphinx with Python 3
Browse files Browse the repository at this point in the history
Our Sphinx configuration gets the current skiboot version by using the
subprocess module to run make_version.sh. In Python 2, this returns a
value of type str, but in Python 3, this returns bytes instead.

Decode those bytes into a string so we see "skiboot 5.6.blah" rather
than "skiboot b'5.6.blah\n'" in the documentation output.

Tested using Sphinx with both Python 2 and 3.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ajdlinux authored and stewartsmith committed Jun 7, 2017
1 parent 55ccb8a commit b0809b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def setup(app):
#
# The short X.Y version.
import subprocess
version = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True)
version = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True).decode()
# The full version, including alpha/beta/rc tags.
release = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True)
release = subprocess.check_output("../make_version.sh | sed -e 's/skiboot-//'", shell=True).decode()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit b0809b8

Please sign in to comment.