Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
A couple of setup.py fixes (apache#5338)
Browse files Browse the repository at this point in the history
* setup: fix long description read in python2

* setup: fix git_get_sha in python3

Fix apache#5317
  • Loading branch information
xrmx authored and timifasubaa committed Jul 25, 2018
1 parent d871d6d commit 004f6d9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import io
import json
import os
import subprocess
Expand All @@ -16,14 +17,14 @@
with open(PACKAGE_FILE) as package_file:
version_string = json.load(package_file)['version']

with open('README.md', encoding='utf-8') as f:
with io.open('README.md', encoding='utf-8') as f:
long_description = f.read()


def get_git_sha():
try:
s = str(subprocess.check_output(['git', 'rev-parse', 'HEAD']))
return s.strip()
s = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
return s.decode().strip()
except Exception:
return ''

Expand Down

0 comments on commit 004f6d9

Please sign in to comment.