Description: Ensure it works with packages available in Debian/Squeeze
  Changes to ensure Django 1.2 support and Python 2.6 support works.
Author: Brian May <bam@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- django-tables-0.9.6.orig/django_tables2/columns.py
+++ django-tables-0.9.6/django_tables2/columns.py
@@ -276,7 +276,7 @@ class LinkColumn(Column):
         # and use that to decide whether to render a link or just the default
         try:
             raw = bound_column.accessor.resolve(record)
-        except (TypeError, AttributeError, KeyError, ValueError) as e:
+        except (TypeError, AttributeError, KeyError, ValueError):
             raw = None
         if raw is None:
             return self.default
--- django-tables-0.9.6.orig/django_tables2/tables.py
+++ django-tables-0.9.6/django_tables2/tables.py
@@ -6,7 +6,6 @@ from django.http import Http404
 from django.utils.datastructures import SortedDict
 from django.template import RequestContext
 from django.template.loader import get_template
-from django.test.client import RequestFactory
 from django.utils.encoding import StrAndUnicode
 import sys
 from .utils import Accessor, AttributeDict, OrderBy, OrderByTuple, Sequence
@@ -285,6 +284,7 @@ class Table(StrAndUnicode):
         generated will clobber the querystring of the request. Use the
         ``{% render_table %}`` template tag instead.
         """
+        from django.test.client import RequestFactory
         request = RequestFactory().get('/')
         template = get_template(self.template)
         return template.render(RequestContext(request, {'table': self}))
