fixes #245 according to http://bugs.python.org/issue10910