Skip to content
Snippets Groups Projects
Commit c36bd88d authored by Masood Malekghassemi's avatar Masood Malekghassemi
Browse files

Merge pull request #5072 from soltanmm/fix

Don't die on missing win32 resources on non-win32
parents e4fdcd92 ae109e9a
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ cimport cpython ...@@ -31,6 +31,7 @@ cimport cpython
import pkg_resources import pkg_resources
import os.path import os.path
import sys
# TODO(atash): figure out why the coverage tool gets confused about the Cython # 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. # coverage plugin when the following files don't have a '.pxi' suffix.
...@@ -50,10 +51,11 @@ cdef class _ModuleState: ...@@ -50,10 +51,11 @@ cdef class _ModuleState:
cdef bint is_loaded cdef bint is_loaded
def __cinit__(self): def __cinit__(self):
filename = pkg_resources.resource_filename( if 'win32' in sys.platform:
'grpc._cython', '_windows/grpc_c.64.python') filename = pkg_resources.resource_filename(
if not pygrpc_load_core(filename): 'grpc._cython', '_windows/grpc_c.64.python')
raise ImportError('failed to load core gRPC library') if not pygrpc_load_core(filename):
raise ImportError('failed to load core gRPC library')
grpc_init() grpc_init()
self.is_loaded = True self.is_loaded = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment