Work around http://bugs.python.org/issue15881