Opened 9 years ago

Closed 9 years ago

#462 closed enhancement (fixed)

Replace _make_safe by functools.wraps

Reported by: Elrond Owned by: Jakob Kramer
Priority: trivial Milestone: 0.3.1
Component: programming Keywords: bitesized
Cc: Parent Tickets:

Description

To make decorators nicer, MediaGoblin has a tiny tool called _make_safe() in decorators.py.

But what this helper tool does, is actually in the standard library!

It's called functools.update_wrapper (1)
There's also a nicer version called functools.wraps (2)

So replace all instances of _make_safe by one of those two.

(1) http://docs.python.org/library/functools#functools.updat_wrapper
(2) http://docs.python.org/library/functools#functools.wraps

Subtickets

Change History (4)

comment:1 Changed 9 years ago by Elrond

Keywords: bitesized added; bite-sized removed

comment:2 Changed 9 years ago by Jakob Kramer

Milestone: 0.3.1
Owner: set to Jakob Kramer
Status: newaccepted

comment:3 Changed 9 years ago by Jakob Kramer

comment:4 Changed 9 years ago by Christopher Allan Webber

Resolution: fixed
Status: acceptedclosed

Looks good. I merged it! Thank you! :)

Note: See TracTickets for help on using tickets.