django-mptt/django-mptt — pull request #231 by tow (2013-01-01 17:36:17+00:00)
Title: python 3 compatibility

Django 1.5 includes experimental support for Python 3, by providing source code compatible with both python 2 & 3.

This commit does the same for django-mptt. (the previous commit also makes a few edits which are required for Django 1.5 even with python-2.

Django 1.5 includes a helper library (django.utils.six) for making this easier; I've used this where appropriate, but haven't relied on it so as not to destroy django 1.4 compatibility. (If this were not an issue, some of the edits would be more straightforward, and I'd use six in a few more places.)

Hopefully the commit message makes sense.

With these patches, nearly all the tests pass under python 3. The only failures are in tests/myapp/doctests.txt, where changes in output format between python2 & 3 mean test failures appearing even though there is no logic failure.

Fixing these is possible but more intrusive. If you're minded to accept the rest of this commit, I'll go ahead and generate a patch for that too.