All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bugtests.test385.py Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4b2
Show newest version
"""
Try importing from a jar after sys.path.append(jar)

This nails down a bug reported here:
    http://sourceforge.net/mailarchive/message.php?msg_id=14088259
which only occurred on systems where java.io.File.separatorChar is not a forward slash ('/')
   
since - at the moment - jython modules hide java packages with the same name from import,
use a unique java package name for the sake of this test 
"""

import jarmaker
import support
import sys

jarfn, package, clazz = jarmaker.mkjar()
# append this jar file to sys.path
sys.path.append(jarfn)

# try to import the class
importStmt = "from %s import %s" % (package, clazz)
try:
    exec(importStmt)
finally:
    sys.path.remove(jarfn)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy