Skip to content
Open
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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.14
current_version = 0.3.14.1
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>(a|b|rc|\.dev)\d+))?
Expand Down
10 changes: 7 additions & 3 deletions src/python_process_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,15 +660,16 @@ pub fn get_windows_python_symbols(
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub fn is_python_lib(pathname: &str) -> bool {
lazy_static! {
static ref RE: Regex = Regex::new(r"/libpython\d.\d\d?(m|d|u)?.so").unwrap();
static ref RE: Regex = Regex::new(r"/libpython\d.\d\d?(m|d|u)?(-pyston\d.\d)?.so").unwrap();
}
RE.is_match(pathname)
}

#[cfg(target_os = "macos")]
pub fn is_python_lib(pathname: &str) -> bool {
lazy_static! {
static ref RE: Regex = Regex::new(r"/libpython\d.\d\d?(m|d|u)?.(dylib|so)$").unwrap();
static ref RE: Regex =
Regex::new(r"/libpython\d.\d\d?(m|d|u)?(-pyston\d.\d)?.(dylib|so)$").unwrap();
}
RE.is_match(pathname) || is_python_framework(pathname)
}
Expand Down Expand Up @@ -715,7 +716,10 @@ mod tests {
#[test]
fn test_is_python_lib() {
// libpython bundled by pyinstaller https://github.com/benfred/py-spy/issues/42
assert!(is_python_lib("/tmp/_MEIOqzg01/libpython2.7.so.1.0"));
assert!(is_python_lib("/usr/lib/libpython3.8-pyston2.3.so.1.0"));

// test pyston based libpython
assert!(is_python_lib("/usr/lib/libpython2.7u.so"));

// test debug/malloc/unicode flags
assert!(is_python_lib("./libpython2.7.so"));
Expand Down