Skip to content

Commit

Permalink
Merge pull request gevent#1842 from gevent/issue1814
Browse files Browse the repository at this point in the history
Updated 1814
  • Loading branch information
jamadden authored Dec 7, 2021
2 parents ecf874c + 43da323 commit e5c31fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changes/1814.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Try to avoid linking to two different Python runtime DLLs on Windows.
9 changes: 9 additions & 0 deletions src/gevent/libuv/_corecffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ def _add_library(name):
if os.uname().sysname != 'OS400':
_add_library('perfstat')
elif WIN:
# All other gevent .pyd files link to the specific minor-version Python
# DLL, so we should do the same here. In virtual environments that don't
# contain the major-version python?.dll stub, _corecffi.pyd would otherwise
# cause the Windows DLL loader to search the entire PATH for a DLL with
# that name. This might end up bringing a second, ABI-incompatible Python
# version into the process, which can easily lead to crashes.
# See https://github.com/gevent/gevent/pull/1814/files
_define_macro('_CFFI_NO_LIMITED_API', 1)

_define_macro('_GNU_SOURCE', 1)
_define_macro('WIN32', 1)
_define_macro('_CRT_SECURE_NO_DEPRECATE', 1)
Expand Down

0 comments on commit e5c31fe

Please sign in to comment.