bpo-37268: test_parser fails when run with -Werror (GH-15183)
Use warnings.filterwarnings() when importing the deprecated parser
module.
@pablogsal
https://bugs.python.org/issue37268
Automerge-Triggered-By: @pablogsal
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index ec1845d..7295f66 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -1,5 +1,9 @@
import copy
-import parser
+import warnings
+with warnings.catch_warnings():
+ warnings.filterwarnings('ignore', 'The parser module is deprecated',
+ DeprecationWarning)
+ import parser
import pickle
import unittest
import operator