From: <pj...@us...> - 2009-10-20 04:25:03
|
Revision: 6885 http://jython.svn.sourceforge.net/jython/?rev=6885&view=rev Author: pjenvey Date: 2009-10-20 04:24:54 +0000 (Tue, 20 Oct 2009) Log Message: ----------- fix missing imports and reference to now fixed os.__name__ Modified Paths: -------------- trunk/jython/Lib/posix.py trunk/jython/Lib/test/test_import_jy.py Modified: trunk/jython/Lib/posix.py =================================================================== --- trunk/jython/Lib/posix.py 2009-10-20 04:04:53 UTC (rev 6884) +++ trunk/jython/Lib/posix.py 2009-10-20 04:24:54 UTC (rev 6885) @@ -278,11 +278,12 @@ FileIO(filename, 'w').close() if exclusive and creating: + from java.io import IOException try: if not File(sys.getPath(filename)).createNewFile(): raise OSError(errno.EEXIST, strerror(errno.EEXIST), filename) - except java.io.IOException, ioe: + except IOException, ioe: raise OSError(ioe) mode = '%s%s%s%s' % (reading and 'r' or '', @@ -541,6 +542,7 @@ rawio = FileDescriptors.get(fd) rawio.checkClosed() + from java.io import IOException from java.nio.channels import FileChannel channel = rawio.getChannel() if not isinstance(channel, FileChannel): @@ -548,7 +550,7 @@ try: channel.force(metadata) - except java.io.IOException, ioe: + except IOException, ioe: raise OSError(ioe) def getpid(): Modified: trunk/jython/Lib/test/test_import_jy.py =================================================================== --- trunk/jython/Lib/test/test_import_jy.py 2009-10-20 04:04:53 UTC (rev 6884) +++ trunk/jython/Lib/test/test_import_jy.py 2009-10-20 04:24:54 UTC (rev 6885) @@ -100,10 +100,8 @@ def test_override(self): modname = os.path.__name__ tests = [ - ("import os.path" , "('os.path', None, -1, '_%s')" - % os._name), - ("import os.path as path2", "('os.path', None, -1, '_%s')" - % os._name), + ("import os.path" , "('os.path', None, -1, 'os')"), + ("import os.path as path2", "('os.path', None, -1, 'os')"), ("from os.path import *" , "('os.path', ('*',), -1, '%s')" % modname), ("from os.path import join", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |