~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/symbol_versioning.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-07-17 02:34:55 UTC
  • mfrom: (3530.2.2 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080717023455-idnyms69oiauf7fh
(jam) Add extra debugging for when a deprecated function/method is
        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",