diff options
| author | Michael Merickel <michael@merickel.org> | 2019-12-26 14:04:32 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-26 14:04:32 -0600 |
| commit | c71001eb97ad6fb1520411d15f7625a4897dd332 (patch) | |
| tree | 165d906c729458b1bb1a36a3d524535f06218a20 /src | |
| parent | 9e61a82458187abdd1747bbd8c38c6089b80b3ab (diff) | |
| parent | 4bc949b2c8a03e6f4dd52b75b2c812fb4d5445a9 (diff) | |
| download | pyramid-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.py | 9 |
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): |
