be compatible with Python 2 and Python 3

In Python 3, cc_err is going to be bytes().
pull/18116/head
Nikolai Lifanov 6 years ago
parent 1d9a18407a
commit 9eb1171dfb
  1. 4
      src/python/grpcio/commands.py

@ -33,6 +33,8 @@ from setuptools.command import test
import support
from typing import Text
PYTHON_STEM = os.path.dirname(os.path.abspath(__file__))
GRPC_STEM = os.path.abspath(PYTHON_STEM + '../../../../')
PROTO_STEM = os.path.join(GRPC_STEM, 'src', 'proto')
@ -222,7 +224,7 @@ class BuildExt(build_ext.build_ext):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
_, cc_err = cc_test.communicate(input='int main(){return 0;}')
return not 'invalid argument' in cc_err
return not 'invalid argument' in Text(cc_err)
# This special conditioning is here due to difference of compiler
# behavior in gcc and clang. The clang doesn't take --stdc++11

Loading…
Cancel
Save