[Python-projects] Flag missing else: clauses?
Andreas Kostyrka
andreas at kostyrka.org
Sat Mar 15 00:08:00 CET 2008
And how often, just as a side note, do you think that fork returns an
error on modern systems?
andreas at andi-lap:/tmp> ulimit -S -u 1
andreas at andi-lap:/tmp> ulimit -H -u 1
andreas at andi-lap:/tmp> /usr/bin/python
bash: fork: Die Ressource ist zur Zeit nicht verfügbar
andreas at andi-lap:/tmp> exec /usr/bin/python
Python 2.4.4 (#2, Jan 3 2008, 13:36:28)
[GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.fork()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
OSError: [Errno 11] Resource temporarily unavailable
>>>
Andreas
Am Freitag, den 14.03.2008, 17:56 -0500 schrieb skip at pobox.com:
> Amaury> Well, there are many places where an else: clause is not needed
> Amaury> at all.
> Amaury> if isinstance(message, unicode):
> Amaury> message = message.encode('utf-8')
> Amaury> Do you want a pylint warning in every case?
>
> No, I'd like to be able to turn it on when I want though. And of course, it
> should be suppressable in the usual ways.
>
> Amaury> BTW, os.fork() and other posix functions never return negative
> Amaury> values in Python. They raise exceptions...
>
> Hmm... I pasted that code right out of the daemonize code, which, if I
> understood the speaker correctly, is actually busy daemonizing Python
> daemons today. I'll pass that along to the author though.
>
> Skip
> _______________________________________________
> Python-Projects mailing list
> Python-Projects at lists.logilab.org
> http://lists.logilab.org/mailman/listinfo/python-projects
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20080315/e5ce474d/attachment.pgp
More information about the Python-Projects
mailing list