work around http://bugs.python.org/issue21121