Fixes a bug with python 2.6 deepcoy, see http://bugs.python.org/issue1515