Skip to content

Commit

Permalink
runtime warning for possible inputhook collision between pyreadline a…
Browse files Browse the repository at this point in the history
…nd qt

See #281

closes gh-550
  • Loading branch information
minrk committed Jul 2, 2011
1 parent 272e128 commit 650ee4b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions IPython/lib/inputhook.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@


import ctypes import ctypes
import sys import sys
import warnings


#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Constants # Constants
Expand Down Expand Up @@ -183,6 +184,17 @@ def enable_qt4(self):
""" """
from IPython.external.qt_for_kernel import QtCore, QtGui from IPython.external.qt_for_kernel import QtCore, QtGui


if 'pyreadline' in sys.modules:
# see IPython GitHub Issue #281 for more info on this issue
# Similar intermittent behavior has been reported on OSX,
# but not consistently reproducible
warnings.warn("""PyReadline's inputhook can conflict with Qt, causing delays
in interactive input. If you do see this issue, we recommend using another GUI
toolkit if you can, or disable readline with the configuration option
'TerminalInteractiveShell.readline_use=False', specified in a config file or
at the command-line""",
RuntimeWarning)

# PyQt4 has had this since 4.3.1. In version 4.2, PyOS_InputHook # PyQt4 has had this since 4.3.1. In version 4.2, PyOS_InputHook
# was set when QtCore was imported, but if it ever got removed, # was set when QtCore was imported, but if it ever got removed,
# you couldn't reset it. For earlier versions we can # you couldn't reset it. For earlier versions we can
Expand Down

0 comments on commit 650ee4b

Please sign in to comment.