fix from #481 for Python 3.2