This works with Python 2.7 but not Python 3.2