Skip to content

Commit

Permalink
Merge pull request grpc#5646 from leifurhauks/import_cygrpc
Browse files Browse the repository at this point in the history
make cygrpc importable on py3
  • Loading branch information
jtattermusch committed Mar 20, 2016
2 parents dadb32a + 38a3d7a commit 950ecbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# Redirect the manifest template from MANIFEST.in to PYTHON-MANIFEST.in.
egg_info.manifest_maker.template = 'PYTHON-MANIFEST.in'

PY3 = sys.version_info.major == 3
PYTHON_STEM = './src/python/grpcio'
CORE_INCLUDE = ('./include', '.',)
BORINGSSL_INCLUDE = ('./third_party/boringssl/include',)
Expand Down Expand Up @@ -103,7 +104,11 @@
LDFLAGS += ('-Wl,-wrap,memcpy',)
if "linux" in sys.platform or "darwin" in sys.platform:
CFLAGS += ('-fvisibility=hidden',)
DEFINE_MACROS += (('PyMODINIT_FUNC', '__attribute__((visibility ("default"))) void'),)

pymodinit_type = 'PyObject*' if PY3 else 'void'

pymodinit = '__attribute__((visibility ("default"))) {}'.format(pymodinit_type)
DEFINE_MACROS += (('PyMODINIT_FUNC', pymodinit),)


def cython_extensions(package_names, module_names, extra_sources, include_dirs,
Expand Down

0 comments on commit 950ecbd

Please sign in to comment.