Chris Carlin wrote:
> http://ftp.belnet.be/linux/gentoo-portage/net-im/pyicq-t/files/pyicq-t-0.8-twisted-2.5.patch).
>
> Anyone know offhand if this is the proper way of doing this?
This is similar to my local patch, but I don't know the history of
Twisted to say it is appropriate to import in that order. It would seems
like a better strategy to try the old way and if it fails, try the new
way. I have included a patch below that is such a patch.
> The underscore in front of _twistd_unix hints to me that it is accessing a
> semi-private or otherwise fluid field.
I agree that it is a semi-private module, but I believe the intent of
making it private is to keep things portable. As we are checking for the
system being posix first, I don't see a problem with doing so. I believe
they removed the other functions from __all__ to keep the footprint
consistent across all platforms (the Win32 version doesn't have a
checkPID). All in all, I think it's fair to break the rules here.
-Scott
--- src/main.py (revision 248)
+++ src/main.py (working copy)
@@ -89,7 +89,11 @@
import signal
signal.signal(signal.SIGHUP, reloadConfig)
# Load scripts for PID and daemonizing
- from twisted.scripts import twistd
+ try:
+ from twisted.scripts import twistd
+ twistd.checkPID
+ except AttributeError:
+ from twisted.scripts import _twistd_unix as twistd
--
Scott Dial
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
py-transports mailing list
[email protected]
http://lists.modevia.com/cgi-bin/mailman/listinfo/py-transports