diff --git a/IPython/genutils.py b/IPython/genutils.py index a816d7f..ecd1aaf 100644 --- a/IPython/genutils.py +++ b/IPython/genutils.py @@ -5,7 +5,7 @@ General purpose utilities. This is a grab-bag of stuff I find useful in most programs I write. Some of these things are also convenient when working at the command line. -$Id: genutils.py 1099 2006-01-29 21:05:57Z vivainio $""" +$Id: genutils.py 1100 2006-01-29 21:27:16Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -149,7 +149,7 @@ Term = IOTerm() import IPython.rlineimpl as readline # Remake Term to use the readline i/o facilities -if readline.have_readline: +if sys.platform == 'win32' and readline.have_readline: Term = IOTerm(cout=readline._outputfile,cerr=readline._outputfile) diff --git a/IPython/rlineimpl.py b/IPython/rlineimpl.py index 3ca563b..3819464 100644 --- a/IPython/rlineimpl.py +++ b/IPython/rlineimpl.py @@ -25,19 +25,21 @@ if sys.platform == 'win32': print "svn co http://ipython.scipy.org/svn/ipython/pyreadline/trunk pyreadline" print "Trying 'old' windows readline." - from readline import * - have_readline = True + try: + from readline import * + have_readline = True + except ImportError: + pass + + if have_readline: + try: + _outputfile=GetOutputFile() + except NameError: + have_readline = False + else: try: from readline import * have_readline = True except ImportError: pass - - -if have_readline: - try: - _outputfile=GetOutputFile() - except AttributeError: - have_readline = False -