From c7f7b482f060e8ccb9259b8c65204cd0ee664183 2011-09-07 11:18:46 From: Thomas Kluyver Date: 2011-09-07 11:18:46 Subject: [PATCH] Fix in preparation for Python 3.3 compatibility. See issue report: https://github.com/ipython/ipython-py3k/issues/11 --- diff --git a/IPython/core/history.py b/IPython/core/history.py index 7666731..186310f 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -75,8 +75,10 @@ class HistoryManager(Configurable): # History saving in separate thread save_thread = Instance('IPython.core.history.HistorySavingThread') - # N.B. Event is a function returning an instance of _Event. - save_flag = Instance(threading._Event) + try: # Event is a function returning an instance of _Event... + save_flag = Instance(threading._Event) + except AttributeError: # ...until Python 3.3, when it's a class. + save_flag = Instance(threading.Event) # Private interface # Variables used to store the three last inputs from the user. On each new