summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteven.bethard <devnull@localhost>2009-09-12 16:48:40 +0000
committersteven.bethard <devnull@localhost>2009-09-12 16:48:40 +0000
commitadfb02cfbbd3205b5f86a475ac4f9080337eb1c5 (patch)
treec835e5476e4dc8ef737f6a76c68d8de0a2a31c29
parentc1d15883256c5962d04deb84e23cc807ad68c59e (diff)
downloadargparse-adfb02cfbbd3205b5f86a475ac4f9080337eb1c5.tar.gz
Silence Python 2.6 buggy warnings about Exception.message.
-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):