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

Detect GIL on 3.9.2 #362

Merged
merged 2 commits into from
Mar 21, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions generate_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def build_python(cpython_path, version):
# TODO: probably easier to use pyenv for this?
print("Compiling python %s from repo at %s" % (version, cpython_path))
install_path = os.path.join(cpython_path, version)
install_path = os.path.abspath(os.path.join(cpython_path, version))

ret = os.system(f"""
cd {cpython_path}
Expand All @@ -42,7 +42,7 @@ def calculate_pyruntime_offsets(cpython_path, version, configure=False):
return ret

if configure:
os.system(f"cd {cpython_path} && ./configure prefix=" + os.path.join(cpython_path, version))
os.system(f"cd {cpython_path} && ./configure prefix=" + os.path.abspath(os.path.join(cpython_path, version)))

# simple little c program to get the offsets we need from the pyruntime struct
# (using rust bindgen here is more complicated than necessary)
Expand Down Expand Up @@ -105,7 +105,7 @@ def extract_bindings(cpython_path, version, configure=False):
git checkout {version}

# need to run configure on the current branch to generate pyconfig.h sometimes
{("./configure prefix=" + os.path.join(cpython_path, version)) if configure else ""}
{("./configure prefix=" + os.path.abspath(os.path.join(cpython_path, version))) if configure else ""}

cat Include/Python.h > bindgen_input.h
cat Include/frameobject.h >> bindgen_input.h
Expand Down
4 changes: 2 additions & 2 deletions src/python_bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub mod pyruntime {
}
},
Version{major: 3, minor: 8, patch: 1..=8, ..} => Some(788),
Version{major: 3, minor: 9, patch: 0..=1, ..} => Some(352),
Version{major: 3, minor: 9, patch: 0..=2, ..} => Some(352),
_ => None
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@ pub mod pyruntime {
}
},
Version{major: 3, minor: 8, patch: 1..=8, ..} => Some(1368),
Version{major: 3, minor: 9, patch: 0..=1, ..} => Some(568),
Version{major: 3, minor: 9, patch: 0..=2, ..} => Some(568),
_ => None
}
}
Expand Down