Skip to content

Commit

Permalink
Another attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Oct 19, 2024
1 parent 8bfb5b0 commit 49c32bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions jpype/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _handleClassPath(
else:
out.append(pth)
if ascii:
return _classpath._SEP.join([i for i in out if i.isascii()])
return [i for i in out if i.isascii()]
return [i for i in out if not i.isascii()]


Expand Down Expand Up @@ -243,7 +243,8 @@ def startJVM(
# Handle strings and list of strings.
extra_jvm_args = ()
if classpath:
extra_jvm_args += (f'-Djava.class.path={_handleClassPath(classpath)}', )
cp = _classpath._SEP.join(_handleClassPath(classpath))
extra_jvm_args += ('-Djava.class.path=%s'%cp, )

supportLib = os.path.join(os.path.dirname(os.path.dirname(__file__)), "org.jpype.jar")
if not os.path.exists(supportLib):
Expand Down
2 changes: 1 addition & 1 deletion native/java/manifest.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Manifest-Version: 1.0
Premain-Class: org.jpype.agent.JPypeAgent
Premain-Class: org.jpype.agent.JPypeAgent
6 changes: 5 additions & 1 deletion native/java/org/jpype/proxy/JPypeProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.jpype.proxy;

import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
Expand Down Expand Up @@ -102,7 +103,10 @@ public Object invoke(Object proxy, Method method, Object[] args)
if (method.isDefault())
{
return MethodHandles.lookup()
.unreflectSpecial(method, method.getDeclaringClass())
.findSpecial(method.getDeclaringClass(),
method.getName(),
MethodType.methodType(method.getReturnType()),
method.getDeclaringClass())
.bindTo(proxy)
.invokeWithArguments(args);
}
Expand Down
2 changes: 1 addition & 1 deletion project/jpype_java/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ source.encoding=UTF-8
src.java.dir=${file.reference.native-java}
test.harness.dir=${file.reference.test-harness}
test.src.dir=test
manifest.file=../../native/jara/manifest.txt
manifest.file=../../native/java/manifest.txt

0 comments on commit 49c32bc

Please sign in to comment.