fix for python 2.7.3 compatibility (http://bugs.python.org/issue10212)