From ec698f9f19c7b9c714c2c00b13d75c3871e35a7f 2011-06-19 17:10:59 From: MinRK Date: 2011-06-19 17:10:59 Subject: [PATCH] use a bytes regex to check for libedit this eases the work of 2to3, which doesn't catch that `out` is bytes. Also use warnings.warn for 'Failed GetOutputFile' message instead of print. --- diff --git a/IPython/utils/rlineimpl.py b/IPython/utils/rlineimpl.py index a69432e..5e081ea 100644 --- a/IPython/utils/rlineimpl.py +++ b/IPython/utils/rlineimpl.py @@ -45,7 +45,7 @@ if sys.platform == 'win32' and have_readline: try: _outputfile=_rl.GetOutputFile() except AttributeError: - print "Failed GetOutputFile" + warnings.warn("Failed GetOutputFile") have_readline = False # Test to see if libedit is being used instead of GNU readline. @@ -86,7 +86,7 @@ if sys.platform == 'darwin' and have_readline: else: break - if p is not None and p.returncode == 0 and re.search(r'/libedit[\.\d+]*\.dylib\s', out): + if p is not None and p.returncode == 0 and re.search(br'/libedit[\.\d+]*\.dylib\s', out): # we are bound to libedit - new in Leopard _rl.parse_and_bind("bind ^I rl_complete") warnings.warn("Leopard libedit detected - readline will not be well behaved "