Skip to content

custom module imported but functions not exported #40

@adrian-rt

Description

@adrian-rt

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions