aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2016-02-04 14:53:46 -0800
committerGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2016-02-04 14:53:46 -0800
commitc36bd88d9837cb5668218fba9e01fb9e7998d2d9 (patch)
tree4a1fe9e3c75e0e719be46de9f478362e3840fea5
parente4fdcd924263edca885b22122e9e7cf148c236fd (diff)
parentae109e9ab60fc267209d586612bf06e427eab028 (diff)
Merge pull request #5072 from soltanmm/fix
Don't die on missing win32 resources on non-win32
-rw-r--r--src/python/grpcio/grpc/_cython/cygrpc.pyx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pyx b/src/python/grpcio/grpc/_cython/cygrpc.pyx
index 3967c3045f..579bac7b8a 100644
--- a/src/python/grpcio/grpc/_cython/cygrpc.pyx
+++ b/src/python/grpcio/grpc/_cython/cygrpc.pyx
@@ -31,6 +31,7 @@ cimport cpython
import pkg_resources
import os.path
+import sys
# TODO(atash): figure out why the coverage tool gets confused about the Cython
# coverage plugin when the following files don't have a '.pxi' suffix.
@@ -50,10 +51,11 @@ cdef class _ModuleState:
cdef bint is_loaded
def __cinit__(self):
- filename = pkg_resources.resource_filename(
- 'grpc._cython', '_windows/grpc_c.64.python')
- if not pygrpc_load_core(filename):
- raise ImportError('failed to load core gRPC library')
+ if 'win32' in sys.platform:
+ filename = pkg_resources.resource_filename(
+ 'grpc._cython', '_windows/grpc_c.64.python')
+ if not pygrpc_load_core(filename):
+ raise ImportError('failed to load core gRPC library')
grpc_init()
self.is_loaded = True