Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PyPy #1171

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions bindings/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ cfg_vars["OPT"] = " ".join( flag for flag in opt.split() if flag not in ['-Wstri
cflags = cfg_vars["CFLAGS"]
cfg_vars["CFLAGS"] = " ".join( flag for flag in cflags.split() if flag not in ['-Wstrict-prototypes' ${CLANG_PROHIBITED} ] ) + " --std=c++0x"

py_cflags = cfg_vars["PY_CFLAGS"]
cfg_vars["PY_CFLAGS"] = " ".join( flag for flag in py_cflags.split() if flag not in ['-Wstrict-prototypes' ${CLANG_PROHIBITED} ] ) + " --std=c++0x"
# pypy doesn't define PY_CFLAGS so skip it if it's missing
if "PY_CFLAGS" in cfg_vars:
py_cflags = cfg_vars["PY_CFLAGS"]
cfg_vars["PY_CFLAGS"] = " ".join( flag for flag in py_cflags.split() if flag not in ['-Wstrict-prototypes' ${CLANG_PROHIBITED} ] ) + " --std=c++0x"

ccl=cfg_vars["CC"].split()
ccl[0]="${CMAKE_C_COMPILER}"
Expand Down
1 change: 0 additions & 1 deletion bindings/python/src/PyXRootDModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ namespace PyXRootD
#endif
{
// Ensure GIL state is initialized
Py_Initialize();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To the best of my knowledge this is only needed when embedding a Python interpreter inside your application: https://docs.python.org/3/c-api/init.html

if ( !PyEval_ThreadsInitialized() ) {
PyEval_InitThreads();
}
Expand Down