summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst3
-rw-r--r--src/pyramid/path.py9
2 files changed, 5 insertions, 7 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 794301578..383906e00 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -68,6 +68,9 @@ Features
``pyramid.static.static_view``.
See https://github.com/Pylons/pyramid/pull/3537
+- Fix ``DeprecationWarning`` emitted by using the ``imp`` module.
+ See https://github.com/Pylons/pyramid/pull/3553
+
Deprecations
------------
diff --git a/src/pyramid/path.py b/src/pyramid/path.py
index 47877ce5d..55ed4df2e 100644
--- a/src/pyramid/path.py
+++ b/src/pyramid/path.py
@@ -1,18 +1,13 @@
+from importlib.machinery import SOURCE_SUFFIXES
import os
import pkg_resources
import sys
-import imp
from zope.interface import implementer
from pyramid.interfaces import IAssetDescriptor
-ignore_types = [imp.C_EXTENSION, imp.C_BUILTIN]
-init_names = [
- '__init__%s' % x[0]
- for x in imp.get_suffixes()
- if x[0] and x[2] not in ignore_types
-]
+init_names = ['__init__%s' % x for x in SOURCE_SUFFIXES]
def caller_path(path, level=2):