From: <nr...@us...> - 2008-08-29 19:58:09
|
Revision: 5269 http://jython.svn.sourceforge.net/jython/?rev=5269&view=rev Author: nriley Date: 2008-08-29 19:58:06 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Raise ImportError when attempting to import pwd, grp modules on Windows. Fixes test_tarfile. Modified Paths: -------------- trunk/jython/Lib/grp.py trunk/jython/Lib/pwd.py Modified: trunk/jython/Lib/grp.py =================================================================== --- trunk/jython/Lib/grp.py 2008-08-29 19:56:54 UTC (rev 5268) +++ trunk/jython/Lib/grp.py 2008-08-29 19:58:06 UTC (rev 5269) @@ -17,9 +17,12 @@ __all__ = ['getgrgid', 'getgrnam', 'getgrall'] -from os import _posix +from os import _name, _posix from java.lang import NullPointerException +if _name == 'nt': + raise ImportError, 'grp module not supported on Windows' + class struct_group(tuple): """ grp.struct_group: Results from getgr*() routines. Modified: trunk/jython/Lib/pwd.py =================================================================== --- trunk/jython/Lib/pwd.py 2008-08-29 19:56:54 UTC (rev 5268) +++ trunk/jython/Lib/pwd.py 2008-08-29 19:58:06 UTC (rev 5269) @@ -10,9 +10,12 @@ __all__ = ['getpwuid', 'getpwnam', 'getpwall'] -from os import _posix +from os import _name, _posix from java.lang import NullPointerException +if _name == 'nt': + raise ImportError, 'pwd module not supported on Windows' + class struct_passwd(tuple): """ pwd.struct_passwd: Results from getpw*() routines. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |