def attachAsDaemon(): """ Attaches the current thread to the JVM as a daemon. Daemon threads act as background tasks and do not prevent the JVM from shutdown normally. JPype automatically attaches any threads that call Java resources as daemon threads. To convert a daemon thread to a user thread, the thread must first be detached. Raises: RuntimeError: If the JVM is not running. """ return _jpype.attachThreadAsDaemon()
def testAttachThreadAsDaemon(self): _jpype.fault("PyJPModule_attachThreadAsDaemon") with self.assertRaisesRegex(SystemError, "fault"): _jpype.attachThreadAsDaemon()