Re: Issue with modulefinder - jython 2.5.3
Jim Baker <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <CAOhO=aPQwww02m1MO=ao3y=B3wQQHL-NQVR969Z=xCWyhLPjpw@mail.gmail.com> |
Two problems: 1. Standalone has issues for inspecting Lib as a filesystem, see http://bugs.jython.org/issue2143 2. But more importantly, modulefinder itself depends on Python bytecode (see https://github.com/jythontools/jython/blob/master/lib-python/2.7/modulefinder.py#L19), which is not compatible with Jython. This is why modulefinder is excluded in 2.7 ( https://github.com/jythontools/jython/blob/master/CPythonLib.includes). Sorry it's in 2.5. I suppose it would be possible to port modulefinder to Jython, but I don't know scope. It could be a useful PyPI project as well. - Jim On Sun, Feb 8, 2015 at 9:59 AM, Pradeep Badiger <[email protected]> wrote: > Hi, > > > > I am trying to use modulefinder module to get the used modules in a python > script. But I get the below exception. > > > > I am using Jython-standalone-2.5.3 engine to execute this script which > prints the modules used by scriptfile.py. I tried using > jython-standalone-2.7-b3.jar and I get no module found error for > “modulefinder”. > > > > Can someone help me in finding the issues with modulefinder. > > > > Exception in thread "main" *javax.script.ScriptException*: > AttributeError: 'tablecode' object has no attribute 'co_consts' in <script> > at line number 4 > > at org.python.jsr223.PyScriptEngine.scriptException( > *PyScriptEngine.java:202*) > > at org.python.jsr223.PyScriptEngine.eval(*PyScriptEngine.java:42*) > > at org.python.jsr223.PyScriptEngine.eval(*PyScriptEngine.java:47*) > > at javax.script.AbstractScriptEngine.eval( > *AbstractScriptEngine.java:249*) > > at com.fico.dmip.scriptjs.JythonModuleScriptExample.main( > *JythonModuleScriptExample.java:44*) > > Caused by: Traceback (most recent call last): > > File "<script>", line 4, in <module> > > File > "C:\Users\pradeepbadiger\.m2\repository\org\python\jython-standalone\2.5.3\jython-standalone-2.5.3.jar\Lib\modulefinder.py", > line 112, in run_script > > File > "C:\Users\pradeepbadiger\.m2\repository\org\python\jython-standalone\2.5.3\jython-standalone-2.5.3.jar\Lib\modulefinder.py", > line 288, in load_module > > File > "C:\Users\pradeepbadiger\.m2\repository\org\python\jython-standalone\2.5.3\jython-standalone-2.5.3.jar\Lib\modulefinder.py", > line 369, in scan_code > > AttributeError: 'tablecode' object has no attribute 'co_consts' > > > > > > Thanks, > > Pradeep V.B. > > > > This email and any files transmitted with it are confidential, proprietary > and intended solely for the individual or entity to whom they are > addressed. If you have received this email in error please delete it > immediately. > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Jython-dev mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jython-dev > > -- - Jim jim.baker@{colorado.edu|python.org|rackspace.com|zyasoft.com} twitter.com/jimbaker github.com/jimbaker bitbucket.com/jimbaker ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jython-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-dev