There are ca 70 packages in the archive that does things like:
try:
eggs()
except OSError, e:
if e.errno == 17:
ham()
This is wrong, because according to POSIX[0], “only […] symbolic names
should be used in programs, since the actual value of the error number
is unspec
You might be easily mislead into thinking that this code
try:
eggs()
except IOError, OSError:
pass
will catch both IOError and OSError exceptions. In fact, it will not, as
it is more or less equivalent to:
try:
eggs()
except IOError, ex:
OSError = ex # Who
Thank you Jakub!
I believe that quick resolution which could be recommended is
instead of
>except IOError, OSError:
having then grouped in a tuple
>except (IOError, OSError):
--
.-.
=-- /v\ =
Kee
Hi Jakub,
2010/8/3 Jakub Wilk :
> You might be easily mislead into thinking that this code
>
> try:
> eggs()
> except IOError, OSError:
> pass
>
> will catch both IOError and OSError exceptions. In fact, it will not, as it
> is more or less equivalent to:
>
> try:
> eggs()
>
2010/8/3 Jakub Wilk :
> You might be easily mislead into thinking that this code
...
> will catch both IOError and OSError exceptions. In fact, it will not, as it
> is more or less equivalent to:
...
> There are about 50 packages in the archive whose developers make this kind
> of mistake. I have a
On Tue, Aug 3, 2010 at 11:47 PM, Paul Wise wrote:
> 2010/8/3 Jakub Wilk :
>> You might be easily mislead into thinking that this code
> ...
>> will catch both IOError and OSError exceptions. In fact, it will not, as it
>> is more or less equivalent to:
> ...
>> There are about 50 packages in the a
On Tue, Aug 3, 2010 at 10:50 PM, Tristan Seligmann
wrote:
> How would you implement the warning? There's no way to easily tell
> whether a given name is an existing class name or not.
Using whatever method Jakub used to create his list, if it is
implementable in perl that is.
Actually, is there
7 matches
Mail list logo