Fix http://bugs.python.org/issue17547 for python 2.6
Merge pull request #804 from pyhalov/python

Fix http://bugs.python.org/issue17547 for python 2.6