summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2019-12-26 14:04:32 -0600
committerGitHub <noreply@github.com>2019-12-26 14:04:32 -0600
commitc71001eb97ad6fb1520411d15f7625a4897dd332 (patch)
tree165d906c729458b1bb1a36a3d524535f06218a20 /src
parent9e61a82458187abdd1747bbd8c38c6089b80b3ab (diff)
parent4bc949b2c8a03e6f4dd52b75b2c812fb4d5445a9 (diff)
downloadpyramid-c71001eb97ad6fb1520411d15f7625a4897dd332.tar.gz
pyramid-c71001eb97ad6fb1520411d15f7625a4897dd332.tar.bz2
pyramid-c71001eb97ad6fb1520411d15f7625a4897dd332.zip
Merge pull request #3555 from mmerickel/deprecated-imp
fix DeprecationWarning of imp package by using importlib
Diffstat (limited to 'src')
-rw-r--r--src/pyramid/path.py9
1 files changed, 2 insertions, 7 deletions
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):