Skip to content

Commit

Permalink
Merge pull request #32 from unnonouno/check-pkgconfig-result
Browse files Browse the repository at this point in the history
Call sys.exit when pkg-config fails
  • Loading branch information
taku910 committed Oct 28, 2017
2 parents 6b4daf1 + d8c21c0 commit 9d82cbd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/setup.py
Expand Up @@ -2,16 +2,21 @@

from setuptools import setup, Extension
import string
import subprocess
import sys
import os

sys.path.append('./test')

with open("README.md") as f:
long_description = f.read()

def cmd(line):
return os.popen(line).readlines()[0][:-1].split()
try:
output = subprocess.check_output(line, shell=True)
except subprocess.CalledProcessError:
sys.stderr.write('Failed to find sentencepiece pkgconfig\n')
sys.exit(1)
return output.strip().split()

setup(name = 'sentencepiece',
author = 'Taku Kudo',
Expand Down

0 comments on commit 9d82cbd

Please sign in to comment.