compatibility fix - makes this work in Python 3.2 and also continue working in Python 2.7