add workaround for http://bugs.python.org/issue16308