deprecated_method combined with staticmethod causes problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Low
|
Martin Pool |
Bug Description
When running the test suite, I saw the following deprecation warning:
DeprecationWarning: __builtin_
wt = WorkingTree.
This is clearly not a method of str().
The definition of this method reads:
@staticmethod
@deprecated
def create_
...
The @deprecated_method decorator wraps the function object in another that prints the deprecated method, inferring the class name from the initial "self" argument.
However, this method is a staticmethod, so no "self" argument is passed. Instead it prints the type of the "directory" argument, which is a string in this case.
Changed in bzr: | |
status: | In Progress → Fix Released |
I think this is fixed by using the other ordering for the decoration. We should documentation that in decorators.py.