From 9d9436bd0ae79893acce4ef0d1005321a7adea6d Mon Sep 17 00:00:00 2001
From: DaNmarner <danmarner@gmail.com>
Date: Mon, 14 Mar 2011 15:36:34 -0500
Subject: [PATCH] Respected pep_3109

---
 django/contrib/gis/gdal/error.py            |    2 +-
 django/test/_doctest.py                     |    4 ++--
 django/utils/unittest/case.py               |    2 +-
 tests/regressiontests/admin_views/models.py |    2 +-
 tests/regressiontests/queries/tests.py      |    2 +-
 tests/regressiontests/templates/tests.py    |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/django/contrib/gis/gdal/error.py b/django/contrib/gis/gdal/error.py
index 58ca891..1d89ad1 100644
--- a/django/contrib/gis/gdal/error.py
+++ b/django/contrib/gis/gdal/error.py
@@ -37,6 +37,6 @@ def check_err(code):
         return
     elif code in OGRERR_DICT:
         e, msg = OGRERR_DICT[code]
-        raise e, msg
+        raise e(msg)
     else:
         raise OGRException('Unknown error code: "%s"' % code)
diff --git a/django/test/_doctest.py b/django/test/_doctest.py
index 17fc88a..485e33c 100644
--- a/django/test/_doctest.py
+++ b/django/test/_doctest.py
@@ -380,9 +380,9 @@ class _OutputRedirectingPdb(pdb.Pdb):
 # [XX] Normalize with respect to os.path.pardir?
 def _module_relative_path(module, path):
     if not inspect.ismodule(module):
-        raise TypeError, 'Expected a module: %r' % module
+        raise TypeError('Expected a module: %r' % module)
     if path.startswith('/'):
-        raise ValueError, 'Module-relative files may not have absolute paths'
+        raise ValueError('Module-relative files may not have absolute paths')
 
     # Find the base directory for the path.
     if hasattr(module, '__file__'):
diff --git a/django/utils/unittest/case.py b/django/utils/unittest/case.py
index 5ae6029..8d943e2 100644
--- a/django/utils/unittest/case.py
+++ b/django/utils/unittest/case.py
@@ -479,7 +479,7 @@ class TestCase(unittest.TestCase):
             excName = excClass.__name__
         else:
             excName = str(excClass)
-        raise self.failureException, "%s not raised" % excName
+        raise self.failureException("%s not raised" % excName)
 
     def _getAssertEqualityFunc(self, first, second):
         """Get a detailed comparison function for the types of the two args.
diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py
index 220b4a3..b65f8a4 100644
--- a/tests/regressiontests/admin_views/models.py
+++ b/tests/regressiontests/admin_views/models.py
@@ -252,7 +252,7 @@ class BasePersonModelFormSet(BaseModelFormSet):
             person = person_dict.get('id')
             alive = person_dict.get('alive')
             if person and alive and person.name == "Grace Hopper":
-                raise forms.ValidationError, "Grace is not a Zombie"
+                raise forms.ValidationError("Grace is not a Zombie")
 
 class PersonAdmin(admin.ModelAdmin):
     list_display = ('name', 'gender', 'alive')
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index c13ca2c..c87ecd3 100644
--- a/tests/regressiontests/queries/tests.py
+++ b/tests/regressiontests/queries/tests.py
@@ -33,7 +33,7 @@ class BaseQuerysetTest(TestCase):
                 excName = exc.__name__
             else:
                 excName = str(exc)
-            raise AssertionError, "%s not raised" % excName
+            raise AssertionError("%s not raised" % excName)
 
 
 class Queries1Tests(BaseQuerysetTest):
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index cb83134..10c7a37 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -389,7 +389,7 @@ class Templates(unittest.TestCase):
             try:
                 return (template_tests[template_name][0] , "test:%s" % template_name)
             except KeyError:
-                raise template.TemplateDoesNotExist, template_name
+                raise template.TemplateDoesNotExist(template_name)
 
         cache_loader = cached.Loader(('test_template_loader',))
         cache_loader._cached_loaders = (test_template_loader,)
-- 
1.7.1

