Re: [PATCH] When catching an OSError, handle it as an object instead of a tuple (#497374).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2009-04-23 at 13:02 -0400, Chris Lumens wrote:
> @@ -226,10 +226,10 @@ def execWithPulseProgress(command, argv, stdin = None, stdout = None,
>      while 1:
>          try:
>              s = os.read(p[0], 1)
> -        except OSError, args:
> -            (num, _str) = args
> +        except OSError as e:
> +            (num, _str) = e.args
>              if (num != 4):
> -                raise IOError, args
> +                raise IOError, e.args
>  
>          os.write(stdout, s)
>          runningLog.write(s)

I'm a little confused by this hunk. Assigning from e.args to a tuple
seems equivalent to the other uses of "except OSError, (num, _str):".

Would it make sense to rewrite that except block to something like:

except OSError as e:
    if (e.errno != 4):
        raise IOError, e.args

for the sake of consistency / clarity? Or is that not worth the effort?

-w

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux