diff options
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/test/test_1413192.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/bsddb/test/test_1413192.py b/Lib/bsddb/test/test_1413192.py index 1d4bd56..3a663e6 100644 --- a/Lib/bsddb/test/test_1413192.py +++ b/Lib/bsddb/test/test_1413192.py @@ -5,7 +5,9 @@ import shutil import tempfile +from test.test_support import catch_warning import warnings + try: # For Pythons w/distutils and add-on pybsddb from bsddb3 import db @@ -33,12 +35,11 @@ class Context: del self.the_txn -warnings.filterwarnings('ignore', 'DBTxn aborted in destructor') -try: +with catch_warning(): + warnings.filterwarnings('ignore', 'DBTxn aborted in destructor') context = Context() del context -finally: - warnings.resetwarnings() + # try not to leave a turd try: |