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
|
b
|
def check_err(code):
|
37 | 37 | return |
38 | 38 | elif code in OGRERR_DICT: |
39 | 39 | e, msg = OGRERR_DICT[code] |
40 | | raise e, msg |
| 40 | raise e(msg) |
41 | 41 | else: |
42 | 42 | raise OGRException('Unknown error code: "%s"' % code) |
diff --git a/django/test/_doctest.py b/django/test/_doctest.py
index 17fc88a..485e33c 100644
a
|
b
|
class _OutputRedirectingPdb(pdb.Pdb):
|
380 | 380 | # [XX] Normalize with respect to os.path.pardir? |
381 | 381 | def _module_relative_path(module, path): |
382 | 382 | if not inspect.ismodule(module): |
383 | | raise TypeError, 'Expected a module: %r' % module |
| 383 | raise TypeError('Expected a module: %r' % module) |
384 | 384 | if path.startswith('/'): |
385 | | raise ValueError, 'Module-relative files may not have absolute paths' |
| 385 | raise ValueError('Module-relative files may not have absolute paths') |
386 | 386 | |
387 | 387 | # Find the base directory for the path. |
388 | 388 | if hasattr(module, '__file__'): |
diff --git a/django/utils/unittest/case.py b/django/utils/unittest/case.py
index 5ae6029..8d943e2 100644
a
|
b
|
class TestCase(unittest.TestCase):
|
479 | 479 | excName = excClass.__name__ |
480 | 480 | else: |
481 | 481 | excName = str(excClass) |
482 | | raise self.failureException, "%s not raised" % excName |
| 482 | raise self.failureException("%s not raised" % excName) |
483 | 483 | |
484 | 484 | def _getAssertEqualityFunc(self, first, second): |
485 | 485 | """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
|
b
|
class BasePersonModelFormSet(BaseModelFormSet):
|
252 | 252 | person = person_dict.get('id') |
253 | 253 | alive = person_dict.get('alive') |
254 | 254 | if person and alive and person.name == "Grace Hopper": |
255 | | raise forms.ValidationError, "Grace is not a Zombie" |
| 255 | raise forms.ValidationError("Grace is not a Zombie") |
256 | 256 | |
257 | 257 | class PersonAdmin(admin.ModelAdmin): |
258 | 258 | list_display = ('name', 'gender', 'alive') |
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index c13ca2c..c87ecd3 100644
a
|
b
|
class BaseQuerysetTest(TestCase):
|
33 | 33 | excName = exc.__name__ |
34 | 34 | else: |
35 | 35 | excName = str(exc) |
36 | | raise AssertionError, "%s not raised" % excName |
| 36 | raise AssertionError("%s not raised" % excName) |
37 | 37 | |
38 | 38 | |
39 | 39 | class Queries1Tests(BaseQuerysetTest): |
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index cb83134..10c7a37 100644
a
|
b
|
class Templates(unittest.TestCase):
|
389 | 389 | try: |
390 | 390 | return (template_tests[template_name][0] , "test:%s" % template_name) |
391 | 391 | except KeyError: |
392 | | raise template.TemplateDoesNotExist, template_name |
| 392 | raise template.TemplateDoesNotExist(template_name) |
393 | 393 | |
394 | 394 | cache_loader = cached.Loader(('test_template_loader',)) |
395 | 395 | cache_loader._cached_loaders = (test_template_loader,) |