From: <pj...@us...> - 2008-10-21 21:59:47
|
Revision: 5501 http://jython.svn.sourceforge.net/jython/?rev=5501&view=rev Author: pjenvey Date: 2008-10-21 21:59:40 +0000 (Tue, 21 Oct 2008) Log Message: ----------- fake support for an EEXIST OSError from mkdir. not 100% correct but this allows pylint to install Modified Paths: -------------- trunk/jython/Lib/os.py Modified: trunk/jython/Lib/os.py =================================================================== --- trunk/jython/Lib/os.py 2008-10-21 21:25:21 UTC (rev 5500) +++ trunk/jython/Lib/os.py 2008-10-21 21:59:40 UTC (rev 5501) @@ -286,8 +286,15 @@ The optional parameter is currently ignored. """ - if not File(sys.getPath(path)).mkdir(): - raise OSError(0, "couldn't make directory", path) + # XXX: use _posix.mkdir when we can get the real errno upon failure + fp = File(sys.getPath(path)) + if not fp.mkdir(): + if fp.isDirectory() or fp.isFile(): + err = errno.EEXIST + else: + err = 0 + msg = errno.strerror(err) if err else "couldn't make directory" + raise OSError(err, msg, path) def makedirs(path, mode='ignored'): """makedirs(path [, mode=0777]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |