~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/symbol_versioning.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-17 01:50:02 UTC
  • mto: This revision was merged to the branch mainline in revision 3549.
  • Revision ID: john@arbash-meinel.com-20080717015002-uhhc7h8ssetsvm2c
Add extra debugging for when a deprecated function/method are called

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
        
139
139
        def decorated_function(*args, **kwargs):
140
140
            """This is the decorated function."""
 
141
            from bzrlib import trace
 
142
            trace.mutter_callsite(4, "Deprecated function called")
141
143
            warn(deprecation_string(callable, deprecation_version),
142
144
                DeprecationWarning, stacklevel=2)
143
145
            return callable(*args, **kwargs)
164
166
        
165
167
        def decorated_method(self, *args, **kwargs):
166
168
            """This is the decorated method."""
 
169
            from bzrlib import trace
167
170
            if callable.__name__ == '__init__':
168
171
                symbol = "%s.%s" % (self.__class__.__module__,
169
172
                                    self.__class__.__name__,
173
176
                                       self.__class__.__name__,
174
177
                                       callable.__name__
175
178
                                       )
 
179
            trace.mutter_callsite(4, "Deprecated method called")
176
180
            warn(deprecation_version % symbol, DeprecationWarning, stacklevel=2)
177
181
            return callable(self, *args, **kwargs)
178
182
        _populate_decorated(callable, deprecation_version, "method",