fix: use EAFP try/except for os.getegid/geteuid in stat() (issue #177)#179
fix: use EAFP try/except for os.getegid/geteuid in stat() (issue #177)#179Quantum0uasar wants to merge 3 commits into
Conversation
…d-custodian#177) Replace LBYL platform check with EAFP try/except AttributeError pattern. os.getegid() and os.geteuid() are unavailable on Windows and other non-POSIX platforms (e.g. WASI), raising AttributeError. Rather than checking the platform up front, wrap the assignments in a try/except block so group_access and user_access are simply omitted when the underlying OS calls are not available. Closes cloud-custodian#177
|
|
@slott56 Hi! Would you be able to take a look when you get a chance? All CI checks are passing — just needs a review to merge. Happy to make any changes if needed. |
|
@Quantum0uasar are you able to do the cncf cla per other pr comment? Direct link https://api.easycla.lfx.linuxfoundation.org/v2/repository-provider/github/sign/14202841/272774581/179/#/?version=2 |
|
Good catch on the EAFP refactor — the
Once the CLA is signed this should be good to go. Thanks for the contribution! |
I will as soon as the CLA is completed. |
Replace LBYL platform check with EAFP try/except AttributeError pattern.
os.getegid() and os.geteuid() are unavailable on Windows and other non-POSIX platforms (e.g. WASI), raising AttributeError. Rather than checking the platform up front, wrap the assignments in a try/except block so group_access and user_access are simply omitted when the underlying OS calls are not available.
Closes #177