Opened 9 years ago

Closed 9 years ago

#5031 closed (wontfix)

Replace Try/except block with pop method with default

Reported by: zigiDev@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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)

kwargsPop.diff (931 bytes) - added by zigiDev@… 9 years ago.
Patch

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by zigiDev@…

Attachment: kwargsPop.diff added

Patch

comment:1 Changed 9 years ago by Adrian Holovaty

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: wontfix
Status: newclosed

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.
Back to Top