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

Fixed library location for Python 3.10. #375

Merged
merged 1 commit into from
Feb 12, 2022
Merged
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
8 changes: 4 additions & 4 deletions src/main/java/jep/LibraryLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private boolean searchSitePackages() {
}
for (File pythonDir : libDir.listFiles()) {
if (pythonDir.isDirectory()
&& pythonDir.getName().matches("python\\d\\.\\d")) {
&& pythonDir.getName().matches("python\\d\\.\\d{1,2}")) {
packagesDir = new File(pythonDir, "site-packages");
if (searchPackageDir(packagesDir)) {
return true;
Expand Down Expand Up @@ -166,7 +166,7 @@ private boolean searchUserSitePackages() {
if (libDir.isDirectory()) {
for (File pythonDir : libDir.listFiles()) {
if (pythonDir.isDirectory()
&& pythonDir.getName().matches("python\\d{2}")) {
&& pythonDir.getName().matches("python\\d{2,3}")) {
File packagesDir = new File(pythonDir, "site-packages");
if (searchPackageDir(packagesDir)) {
return true;
Expand All @@ -183,7 +183,7 @@ private boolean searchUserSitePackages() {
if (libDir.isDirectory()) {
for (File pythonDir : libDir.listFiles()) {
if (pythonDir.isDirectory()
&& pythonDir.getName().matches("python\\d\\.\\d")) {
&& pythonDir.getName().matches("python\\d\\.\\d{1,2}")) {
File packagesDir = new File(pythonDir, "site-packages");
if (searchPackageDir(packagesDir)) {
return true;
Expand All @@ -201,7 +201,7 @@ private boolean searchUserSitePackages() {
File pythonMainDir = new File(localDir, "Python");
if (pythonMainDir.isDirectory()) {
for (File versionDir : pythonMainDir.listFiles()) {
if (versionDir.isDirectory() && versionDir.getName().matches("\\d\\.\\d")) {
if (versionDir.isDirectory() && versionDir.getName().matches("\\d\\.\\d{1,2}")) {
File libDir = new File(versionDir, "lib");
if (libDir.isDirectory()) {
File pythonDir = new File(libDir, "python");
Expand Down