Index: src/org/python/core/PyFunction.java =================================================================== --- src/org/python/core/PyFunction.java (revision 6980) +++ src/org/python/core/PyFunction.java (working copy) @@ -397,14 +397,19 @@ public Object __tojava__(Class c) { // Automatically coerce to single method interfaces if (c.isInterface() && c.getDeclaredMethods().length == 1) { + final Method interfaceMethod = c.getDeclaredMethods()[0]; return Proxy.newProxyInstance(c.getClassLoader(), new Class[]{c}, new InvocationHandler() { // XXX: not the most efficient implementation - the invocation handler could be shared public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if (args == null || args.length == 0) { - return __call__().__tojava__(method.getReturnType()); - } else { - return __call__(Py.javas2pys(args)).__tojava__(method.getReturnType()); - } + if (method.equals(interfaceMethod)) { + if (args == null || args.length == 0) { + return __call__().__tojava__(method.getReturnType()); + } else { + return __call__(Py.javas2pys(args)).__tojava__(method.getReturnType()); + } + } else { + return method.invoke(this, args); + } } }); }