Remove dead code
The 'monkeypatch_method' function no longer has any callers and can be removed. Change-Id: I402eb482d2c1db7331bd872c5169db8e59c9a34f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
07de844615
commit
87637bdf1d
15
pbr/util.py
15
pbr/util.py
|
@ -674,21 +674,6 @@ def split_csv(value):
|
|||
return value
|
||||
|
||||
|
||||
def monkeypatch_method(cls):
|
||||
"""A function decorator to monkey-patch a method of the same name on the
|
||||
given class.
|
||||
"""
|
||||
|
||||
def wrapper(func):
|
||||
orig = getattr(cls, func.__name__, None)
|
||||
if orig and not hasattr(orig, '_orig'): # Already patched
|
||||
setattr(func, '_orig', orig)
|
||||
setattr(cls, func.__name__, func)
|
||||
return func
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
# The following classes are used to hack Distribution.command_options a bit
|
||||
class DefaultGetDict(defaultdict):
|
||||
"""Like defaultdict, but the get() method also sets and returns the default
|
||||
|
|
Loading…
Reference in New Issue