[PATCH] util: pass sysstrs to warnings.filterwarnings

Augie Fackler raf at durin42.com
Thu Apr 13 13:16:10 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1492103569 14400
#      Thu Apr 13 13:12:49 2017 -0400
# Node ID a34b5e7c66830e2f13e4ec32f7abbd64a06a5b8a
# Parent  f23d579a5a04e44f5e0370ba13ad20dd626e8ad7
util: pass sysstrs to warnings.filterwarnings

Un-breaks the Python 3 build.

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -168,9 +168,9 @@ if _dowarn:
     # However, module name set through PYTHONWARNINGS was exactly matched, so
     # we cannot set 'mercurial' and have it match eg: 'mercurial.scmutil'. This
     # makes the whole PYTHONWARNINGS thing useless for our usecase.
-    warnings.filterwarnings('default', '', DeprecationWarning, 'mercurial')
-    warnings.filterwarnings('default', '', DeprecationWarning, 'hgext')
-    warnings.filterwarnings('default', '', DeprecationWarning, 'hgext3rd')
+    warnings.filterwarnings(r'default', r'', DeprecationWarning, r'mercurial')
+    warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext')
+    warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext3rd')
 
 def nouideprecwarn(msg, version, stacklevel=1):
     """Issue an python native deprecation warning


More information about the Mercurial-devel mailing list