fixed syntax of an exception for python 3 compatibility

One of the patches for django to add nonrel support broke python 3 compatibility by using an old syntax.

See http://www.python.org/dev/peps/pep-3110/ for details on the grammar change, but in short, the `except LookupError, e:` would be replaced with `except LookupError as e:`.