Reputation: 6567
I'm experimenting with running twisted/crossbar.io on QNX (target:powerpc-unknown-nto-qnx6.5.0), however it appears that QNX does not have siginterrupt()
and SA_RESTART
flag is not supported. As result signals.siginterrupt() does not exist in embedded python.
Is there any way to run/patch python/twisted on a system like this? Right now it dies when the handlers are installed because signals
module does not have siginterrupt()
. Even in the old 2.6 days when iternet/signals were built as c library, they relied on essentially implementing siginterrupt using SA_RESTART.
Is there any other alternative?
Upvotes: 0
Views: 212
Reputation: 48335
Is there any way to run/patch python/twisted on a system like this?
The general answer is "port Twisted to your target platform". Twisted has interacts extensively with the platform it is running on. You might trick it into not dying with an AttributeError
in one place with a simple patch but this doesn't mean that Twisted will actually behave the way it is intended to behave.
Do you have plans to complete a porting effort of Twisted to QNX? Or do you just have your fingers crossed that with signal issues out of the way everything else will Just Work? At minimum, you should be running the test suite to see where there may be problems (though passing tests also don't guarantee Twisted is actually working correctly, since those tests were all written with other platforms in mind).
A more specific answer is that you could grab an older version of the twisted.internet._signals
module (try r35834; r35835 deleted a lot of old support code). The Python 3 porting effort removed some of the alternate (not as good but more portable) signal handling strategies from this module.
Upvotes: 1
Reputation: 31860
Did you try reactor.run(installSignalHandlers=False)
? This limits the reactor's functionality a bit, but it may allow you to limp along.
Upvotes: 1