Ticket #15609: respect_pep3109.patch

File respect_pep3109.patch, 4.1 KB (added by Daniel Duan, 13 years ago)
  • django/contrib/gis/gdal/error.py

    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):  
    3737        return
    3838    elif code in OGRERR_DICT:
    3939        e, msg = OGRERR_DICT[code]
    40         raise e, msg
     40        raise e(msg)
    4141    else:
    4242        raise OGRException('Unknown error code: "%s"' % code)
  • django/test/_doctest.py

    diff --git a/django/test/_doctest.py b/django/test/_doctest.py
    index 17fc88a..485e33c 100644
    a b class _OutputRedirectingPdb(pdb.Pdb):  
    380380# [XX] Normalize with respect to os.path.pardir?
    381381def _module_relative_path(module, path):
    382382    if not inspect.ismodule(module):
    383         raise TypeError, 'Expected a module: %r' % module
     383        raise TypeError('Expected a module: %r' % module)
    384384    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')
    386386
    387387    # Find the base directory for the path.
    388388    if hasattr(module, '__file__'):
  • django/utils/unittest/case.py

    diff --git a/django/utils/unittest/case.py b/django/utils/unittest/case.py
    index 5ae6029..8d943e2 100644
    a b class TestCase(unittest.TestCase):  
    479479            excName = excClass.__name__
    480480        else:
    481481            excName = str(excClass)
    482         raise self.failureException, "%s not raised" % excName
     482        raise self.failureException("%s not raised" % excName)
    483483
    484484    def _getAssertEqualityFunc(self, first, second):
    485485        """Get a detailed comparison function for the types of the two args.
  • tests/regressiontests/admin_views/models.py

    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):  
    252252            person = person_dict.get('id')
    253253            alive = person_dict.get('alive')
    254254            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")
    256256
    257257class PersonAdmin(admin.ModelAdmin):
    258258    list_display = ('name', 'gender', 'alive')
  • tests/regressiontests/queries/tests.py

    diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
    index c13ca2c..c87ecd3 100644
    a b class BaseQuerysetTest(TestCase):  
    3333                excName = exc.__name__
    3434            else:
    3535                excName = str(exc)
    36             raise AssertionError, "%s not raised" % excName
     36            raise AssertionError("%s not raised" % excName)
    3737
    3838
    3939class Queries1Tests(BaseQuerysetTest):
  • tests/regressiontests/templates/tests.py

    diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
    index cb83134..10c7a37 100644
    a b class Templates(unittest.TestCase):  
    389389            try:
    390390                return (template_tests[template_name][0] , "test:%s" % template_name)
    391391            except KeyError:
    392                 raise template.TemplateDoesNotExist, template_name
     392                raise template.TemplateDoesNotExist(template_name)
    393393
    394394        cache_loader = cached.Loader(('test_template_loader',))
    395395        cache_loader._cached_loaders = (test_template_loader,)
Back to Top