summaryrefslogtreecommitdiff
path: root/Lib/modulefinder.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-16 13:13:40 -0400
committerBrett Cannon <brett@python.org>2013-06-16 13:13:40 -0400
commit4fb327ac26d476c60af925835317aee8f315e9d8 (patch)
tree5edc5d98ca2cdbec9eb78b62f183c4085156f964 /Lib/modulefinder.py
parent8fc2f21cb2c0122c000dbc79fd87ecbfd1740790 (diff)
downloadcpython-4fb327ac26d476c60af925835317aee8f315e9d8.tar.gz
Issue #17177: The imp module is pending deprecation.
To make sure there is no issue with code that is both Python 2 and 3 compatible, there are no plans to remove the module any sooner than Python 4 (unless the community moves to Python 3 solidly before then).
Diffstat (limited to 'Lib/modulefinder.py')
-rw-r--r--Lib/modulefinder.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index 4996d7a20b..e3ad7d62a7 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -1,13 +1,16 @@
"""Find modules used by a script, using introspection."""
import dis
-import imp
import importlib.machinery
import marshal
import os
import sys
import types
import struct
+import warnings
+with warnings.catch_warnings():
+ warnings.simplefilter('ignore', PendingDeprecationWarning)
+ import imp
# XXX Clean up once str8's cstor matches bytes.
LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')])