summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-07-18 13:14:57 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-07-18 13:14:57 (GMT)
commit76e077001d9c593faaec1aa5187dd7870cb4481c (patch)
tree8ac59cf5a5321a0cef8cdf56a4681cf46969cb73 /Lib/importlib
parent90db661b4335eaf7a3cb5e9a4524ae9707eeaf76 (diff)
downloadcpython-76e077001d9c593faaec1aa5187dd7870cb4481c.zip
cpython-76e077001d9c593faaec1aa5187dd7870cb4481c.tar.gz
cpython-76e077001d9c593faaec1aa5187dd7870cb4481c.tar.bz2
Close #15387: inspect.getmodulename() now uses a new importlib.machinery.all_suffixes() API rather than the deprecated inspect.getmoduleinfo()
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/machinery.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/importlib/machinery.py b/Lib/importlib/machinery.py
index d5e7250..3fe0b11 100644
--- a/Lib/importlib/machinery.py
+++ b/Lib/importlib/machinery.py
@@ -13,3 +13,7 @@ from ._bootstrap import SourcelessFileLoader
from ._bootstrap import ExtensionFileLoader
EXTENSION_SUFFIXES = _imp.extension_suffixes()
+
+def all_suffixes():
+ """Returns a list of all recognized module suffixes for this process"""
+ return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES