Additional import statement might need to be added in else blocks

If a Jacl script when converted into Jython scripts uses the Jython runtime Lib library modules, the generated Jython output from Jacl2Jython program contains one import statement per def module definition. If the initial code function is inside an if statement and there is another usage inside an else statement, then you need to add another import statement. This additional import statement is not generated because the Jacl2Jython program does not track the runtime structure.
JACL:   if {123} {
JACL:       set names [glob "/*"]
JACL:   }else{
JACL:       set names [glob "$distDir/*"]
JACL:   }
==>
JYTHON: if (123):
JYTHON:     import glob
JYTHON:     names = glog.glob("/*" )
JYTHON: else
JYTHON:     import glob  # you need to manually add this additional import statement
JYTHON:     names = glog.glob( distDir+"/*" )
JYTHON: #endIf
In this example, the glob is a library module defined in the Jython lib directory. The Jython lib directory is located in the x:/optionalLibraries/jython, where x is the installation directory of WebSphere Application Server v6.1.

Feedback