[Jython-checkins] jython: Support readline.set_startup_hook to be set to None
jim.baker
jython-checkins at python.org
Sat Feb 7 03:38:21 CET 2015
https://hg.python.org/jython/rev/0a0bf07d7e7d
changeset: 7574:0a0bf07d7e7d
user: Geoffrey French <britefury at gmail.com>
date: Fri Feb 06 19:31:13 2015 -0700
summary:
Support readline.set_startup_hook to be set to None
files:
src/org/python/util/JLineConsole.java | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/org/python/util/JLineConsole.java b/src/org/python/util/JLineConsole.java
--- a/src/org/python/util/JLineConsole.java
+++ b/src/org/python/util/JLineConsole.java
@@ -19,6 +19,7 @@
import org.python.core.PlainConsole;
import org.python.core.PyObject;
+import org.python.core.Py;
/**
* This class uses <a href="http://jline.sourceforge.net/">JLine</a> to provide readline like
@@ -259,6 +260,10 @@
* Sets the startup hook (called prior to each readline)
*/
public void setStartupHook(PyObject hook) {
+ // Convert None to null here, so that readerReadLine can use only a null check
+ if (hook == Py.None) {
+ hook = null;
+ }
startup_hook = hook;
}
}
--
Repository URL: https://hg.python.org/jython
More information about the Jython-checkins
mailing list