From: <pj...@us...> - 2010-04-14 01:59:21
|
Revision: 7025 http://jython.svn.sourceforge.net/jython/?rev=7025&view=rev Author: pjenvey Date: 2010-04-14 01:59:14 +0000 (Wed, 14 Apr 2010) Log Message: ----------- small posix cleanup, remove its now unneeded initEncoding workaround Modified Paths: -------------- trunk/jython/src/org/python/core/PySystemState.java trunk/jython/src/org/python/modules/posix/Hider.java trunk/jython/src/org/python/modules/posix/PosixModule.java Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2010-04-13 02:16:14 UTC (rev 7024) +++ trunk/jython/src/org/python/core/PySystemState.java 2010-04-14 01:59:14 UTC (rev 7025) @@ -169,13 +169,7 @@ stdin = __stdin__ = new PyFile(System.in, "<stdin>", "r" + mode, buffering, false); stdout = __stdout__ = new PyFile(System.out, "<stdout>", "w" + mode, buffering, false); stderr = __stderr__ = new PyFile(System.err, "<stderr>", "w" + mode, 0, false); - if (Py.getSystemState() != null) { - // XXX: initEncoding fails without an existing sys module as it can't import - // os (for os.isatty). In that case PySystemState.doInitialize calls it for - // us. The correct fix for this is rewriting the posix/nt module portions of - // os in Java - initEncoding(); - } + initEncoding(); __displayhook__ = new PySystemStateFunctions("displayhook", 10, 1, 1); __excepthook__ = new PySystemStateFunctions("excepthook", 30, 3, 3); Modified: trunk/jython/src/org/python/modules/posix/Hider.java =================================================================== --- trunk/jython/src/org/python/modules/posix/Hider.java 2010-04-13 02:16:14 UTC (rev 7024) +++ trunk/jython/src/org/python/modules/posix/Hider.java 2010-04-14 01:59:14 UTC (rev 7025) @@ -25,8 +25,9 @@ * @param native whether the underlying posix is native */ public static void hideFunctions(Class<?> cls, PyObject dict, OS os, boolean isNative) { + PosixImpl posixImpl = isNative ? PosixImpl.NATIVE : PosixImpl.JAVA; for (Method method: cls.getDeclaredMethods()) { - if (isHidden(method, os, isNative ? PosixImpl.NATIVE : PosixImpl.JAVA)) { + if (isHidden(method, os, posixImpl)) { dict.__setitem__(method.getName(), null); } } Modified: trunk/jython/src/org/python/modules/posix/PosixModule.java =================================================================== --- trunk/jython/src/org/python/modules/posix/PosixModule.java 2010-04-13 02:16:14 UTC (rev 7024) +++ trunk/jython/src/org/python/modules/posix/PosixModule.java 2010-04-14 01:59:14 UTC (rev 7025) @@ -118,6 +118,7 @@ // Hide from Python Hider.hideFunctions(PosixModule.class, dict, os, nativePosix); dict.__setitem__("classDictInit", null); + dict.__setitem__("__init__", null); dict.__setitem__("getPOSIX", null); dict.__setitem__("getOSName", null); dict.__setitem__("badFD", null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |