Rev 6164: Turn it into a DeprecationWarning. in http://bazaar.launchpad.net/~jameinel/bzr/drop-idle-connections-824797

John Arbash Meinel john at arbash-meinel.com
Thu Sep 15 13:10:17 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/drop-idle-connections-824797

------------------------------------------------------------
revno: 6164
revision-id: john at arbash-meinel.com-20110915131003-vhca56irzrjifkmh
parent: john at arbash-meinel.com-20110915130441-shwe4u0qj4foaxwy
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: drop-idle-connections-824797
timestamp: Thu 2011-09-15 15:10:03 +0200
message:
  Turn it into a DeprecationWarning.
  
  The warning is ugly, but it will be suppressed in release versions.
  This should let developers of 'bzr-svn/git/loggerhead' see that
  they need to update their code.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2011-09-15 13:04:41 +0000
+++ b/bzrlib/builtins.py	2011-09-15 13:10:03 +0000
@@ -5222,11 +5222,15 @@
         try:
             protocol(t, host, port, inet, client_timeout)
         except TypeError, e:
-            # TODO: This should really be a deprecation warning
-            warning('Got TypeError(%s)\ntrying to call protocol: %s.%s\n'
-                    'Most likely it needs to be updated to support a'
-                    ' "timeout" parameter'
-                    % (e, protocol.__module__, protocol))
+            # We use symbol_versioning.deprecated_in just so that people
+            # grepping can find it here.
+            # symbol_versioning.deprecated_in((2, 5, 0))
+            symbol_versioning.warn(
+                'Got TypeError(%s)\ntrying to call protocol: %s.%s\n'
+                'Most likely it needs to be updated to support a'
+                ' "timeout" parameter (added in bzr 2.5.0)'
+                % (e, protocol.__module__, protocol),
+                DeprecationWarning)
             protocol(t, host, port, inet)
 
 



More information about the bazaar-commits mailing list