Drew,

Sounds good.

Drew, Sue, Evan,

I have an updated webrev at:

    http://cr.opensolaris.org/~johnfisc/7021903-list-sparc-clients-3/
    http://cr.opensolaris.org/~johnfisc/7021903-list-sparc-clients-diff-3/

This has been updated to remove the try/except clause in favor of the
os.path.exists()/os.path.isdir() combination.  I have also updated the
comment nit that Evan raised.

Thanks,

John

On 02/23/11 05:42 PM, Drew Fisher wrote:
I strongly dislike using try/except as a control-structure. I would prefer you to use built-in function which return True/False.

-Drew

On 2/23/11 6:07 PM, John Fischer wrote:
Drew,

Sue mentioned that as well. This will not catch the case where the clientdir
does not exist which will cause an exception.

I could:

    if not os.path.exists(path) or not os.path.isdir(path):
        continue

Then do the for loop which contains the os.listdir(path) call.

Do you still think that the os.path.isdir()/os.path.exists() is the better
route then the try/except?  If so then I'll make that change.

Thanks,

John

On 02/23/11 04:36 PM, Drew Fisher wrote:
John,

Why not use os.path.isdir(clientdir) which will not raise an exception?

If it's a file, it'll return False and you can continue to the next entry.

-Drew

_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to