Code

Opened 3 years ago

Closed 3 years ago

#16323 closed Uncategorized (invalid)

Typo in 'Raising 404' listing

Reported by: anonymous Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords: typo
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

in the 'Raising 404' listing there is a simple typo:
Http404 is a function that's why line 7 should be

raise Http404()

and not raise Http404

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Http404 is not a function; it's a class and it inherits Exception.

Python allows raising exceptions like this: http://docs.python.org/tutorial/errors.html#raising-exceptions

The sole argument to raise indicates the exception to be raised. This must be either an exception instance or an exception class (a class that derives from Exception).

A grep over the source and docs shows that both kinds or raise (with a class or an instance) are commonly used.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.