From: <pj...@us...> - 2008-10-18 20:23:04
|
Revision: 5462 http://jython.svn.sourceforge.net/jython/?rev=5462&view=rev Author: pjenvey Date: 2008-10-18 20:23:01 +0000 (Sat, 18 Oct 2008) Log Message: ----------- fix os.access to never raise an exception with a valid mode, which I broke in r5420 Modified Paths: -------------- trunk/jython/Lib/os.py Modified: trunk/jython/Lib/os.py =================================================================== --- trunk/jython/Lib/os.py 2008-10-18 19:03:40 UTC (rev 5461) +++ trunk/jython/Lib/os.py 2008-10-18 20:23:01 UTC (rev 5462) @@ -428,9 +428,12 @@ result = False if mode & W_OK and not f.canWrite(): result = False - if mode & X_OK and not (stat(path).st_mode & _stat.S_IEXEC): + if mode & X_OK: # NOTE: always False without jna-posix stat - result = False + try: + result = (stat(path).st_mode & _stat.S_IEXEC) != 0 + except OSError: + result = False return result def stat(path): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |