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

custom module imported but functions not exported #40

Open
adrian-rt opened this issue Jul 12, 2022 · 1 comment
Open

custom module imported but functions not exported #40

adrian-rt opened this issue Jul 12, 2022 · 1 comment

Comments

@adrian-rt
Copy link

Hi,

I wrote my custom module in C for Python and I can imported like this:
java -cp jython-standalone-2.7.2.jar:Lib/JyNI.jar org.python.util.jython test.py
The problem is that my functions are not exported and I can't call them allthough the module is successfully imported.

test.py contains the following:

import mtrand print(dir(mtrand)) print(mtrand.__file__)

and the output is
['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'mtrand']
If I run the same thing under python2 I can see all the exported funcitons:

`python
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import mtrand
dir(mtrand)
['author', 'builtins', 'doc', 'file', 'name', 'package', 'test', 'mt_rand', 'mt_rand_ab', 'mt_rand_orig', 'mt_srand']

`

So, why are my functions not exprted with JyNI?

Thank you!

@adrian-rt
Copy link
Author

ps: my extension was compiled with cython.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant