summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--argparse.py9
-rw-r--r--test/test_argparse.py8
2 files changed, 17 insertions, 0 deletions
diff --git a/argparse.py b/argparse.py
index 1996f46..0f407e7 100644
--- a/argparse.py
+++ b/argparse.py
@@ -118,6 +118,15 @@ except NameError:
result.reverse()
return result
+# silence Python 2.6 buggy warnings about Exception.message
+if _sys.version_info[:2] == (2, 6):
+ import warnings
+ warnings.filterwarnings(
+ action='ignore',
+ message='BaseException.message has been deprecated as of Python 2.6',
+ category=DeprecationWarning,
+ module='argparse')
+
SUPPRESS = '==SUPPRESS=='
diff --git a/test/test_argparse.py b/test/test_argparse.py
index ad2be1a..6939380 100644
--- a/test/test_argparse.py
+++ b/test/test_argparse.py
@@ -44,6 +44,14 @@ except NameError:
result.reverse()
return result
+# silence Python 2.6 buggy warnings about Exception.message
+if sys.version_info[:2] == (2, 6):
+ import warnings
+ warnings.filterwarnings(
+ action='ignore',
+ message='BaseException.message has been deprecated as of Python 2.6',
+ category=DeprecationWarning)
+
class TestCase(unittest.TestCase):