Permalink
Browse files

Fix in preparation for Python 3.3 compatibility.

  • Loading branch information...
1 parent 4408c4c commit c7f7b482f060e8ccb9259b8c65204cd0ee664183 @takluyver committed Aug 1, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 IPython/core/history.py
View
@@ -75,8 +75,10 @@ def _dir_hist_default(self):
# 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

0 comments on commit c7f7b48

Please sign in to comment.