Opened 18 years ago
Closed 18 years ago
#5031 closed (wontfix)
Replace Try/except block with pop method with default
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Replace try/except block around pop call with a pop which provides a default (as to match the pop call in the penultimate else clause for this block). I'm pedantic. :)
Attachments (1)
Change History (2)
by , 18 years ago
| Attachment: | kwargsPop.diff added |
|---|
comment:1 by , 18 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
If I may be pedantic right back... :-)
The problem with this patch is that this statement:
kwargs.pop(field.attname, field.get_default())
...causes field.get_default() to be executed in any case. We're avoiding that by doing another try/except.
Note:
See TracTickets
for help on using tickets.
Patch