We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db3774d commit 36d952dCopy full SHA for 36d952d
Lib/test/test_pickle.py
@@ -6,6 +6,7 @@
6
import collections
7
import struct
8
import sys
9
+import warnings
10
import weakref
11
12
import unittest
@@ -367,7 +368,10 @@ def getmodule(module):
367
368
return sys.modules[module]
369
except KeyError:
370
try:
- __import__(module)
371
+ with warnings.catch_warnings():
372
+ action = 'always' if support.verbose else 'ignore'
373
+ warnings.simplefilter(action, DeprecationWarning)
374
+ __import__(module)
375
except AttributeError as exc:
376
if support.verbose:
377
print("Can't import module %r: %s" % (module, exc))
0 commit comments