Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #15609 -- Fixed some 'raise' statements to use the newer style …

…syntax. Thanks, DaNmarner

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4e25bc71b18e609768c4cf99854f350a5bc8e44d 1 parent f43b3f5
@adrianholovaty adrianholovaty authored
View
2  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)
View
4 django/test/_doctest.py
@@ -380,9 +380,9 @@ def trace_dispatch(self, *args):
# [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__'):
View
2  django/utils/unittest/case.py
@@ -479,7 +479,7 @@ def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
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.
View
2  tests/regressiontests/admin_views/models.py
@@ -252,7 +252,7 @@ def clean(self):
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')
View
2  tests/regressiontests/queries/tests.py
@@ -33,7 +33,7 @@ def assertRaisesMessage(self, exc, msg, func, *args, **kwargs):
excName = exc.__name__
else:
excName = str(exc)
- raise AssertionError, "%s not raised" % excName
+ raise AssertionError("%s not raised" % excName)
class Queries1Tests(BaseQuerysetTest):
View
2  tests/regressiontests/templates/tests.py
@@ -389,7 +389,7 @@ def test_template_loader(template_name, template_dirs=None):
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,)
Please sign in to comment.
Something went wrong with that request. Please try again.