Преглед на файлове

Use "catch" instead of "trap" for exceptions.

This is the idiomatic word in the Python world.
Aymeric Augustin преди 10 години
родител
ревизия
aa399f6b8b
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 2 2
      django/contrib/auth/management/commands/createsuperuser.py
  2. 2 2
      docs/topics/pagination.txt

+ 2 - 2
django/contrib/auth/management/commands/createsuperuser.py

@@ -76,8 +76,8 @@ class Command(BaseCommand):
 
         else:
             # Prompt for username/password, and any other required fields.
-            # Enclose this whole thing in a try/except to trap for a
-            # keyboard interrupt and exit gracefully.
+            # Enclose this whole thing in a try/except to catch
+            # KeyboardInterrupt and exit gracefully.
             default_username = get_default_username()
             try:
 

+ 2 - 2
docs/topics/pagination.txt

@@ -204,8 +204,8 @@ Attributes
 
 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
-to trap the ``InvalidPage`` exception, but if you'd like more granularity, you
-can trap either of the following exceptions:
+to catch the ``InvalidPage`` exception, but if you'd like more granularity,
+you can catch either of the following exceptions:
 
 .. exception:: PageNotAnInteger