mirror of https://github.com/django/django.git
Use "catch" instead of "trap" for exceptions.
This is the idiomatic word in the Python world.
This commit is contained in:
parent
d4467ede77
commit
aa399f6b8b
|
@ -76,8 +76,8 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Prompt for username/password, and any other required fields.
|
# Prompt for username/password, and any other required fields.
|
||||||
# Enclose this whole thing in a try/except to trap for a
|
# Enclose this whole thing in a try/except to catch
|
||||||
# keyboard interrupt and exit gracefully.
|
# KeyboardInterrupt and exit gracefully.
|
||||||
default_username = get_default_username()
|
default_username = get_default_username()
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
|
|
@ -204,8 +204,8 @@ Attributes
|
||||||
|
|
||||||
The :meth:`Paginator.page` method raises an exception if the requested page is
|
The :meth:`Paginator.page` method raises an exception if the requested page is
|
||||||
invalid (i.e., not an integer) or contains no objects. Generally, it's enough
|
invalid (i.e., not an integer) or contains no objects. Generally, it's enough
|
||||||
to trap the ``InvalidPage`` exception, but if you'd like more granularity, you
|
to catch the ``InvalidPage`` exception, but if you'd like more granularity,
|
||||||
can trap either of the following exceptions:
|
you can catch either of the following exceptions:
|
||||||
|
|
||||||
.. exception:: PageNotAnInteger
|
.. exception:: PageNotAnInteger
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue