Skip to content

Commit

Permalink
Fixed library location for Python 3.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
notiska authored and bsteffensmeier committed Feb 12, 2022
1 parent 1a7b990 commit efde9b5
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit efde9b5

Please sign in to comment.