diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-23 14:49:00 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-23 14:49:00 (GMT) |
commit | 6dfbc5d98eee400fa7b775b53c11a4e37fca3547 (patch) | |
tree | 55814dd0db1c026013bfdc912a1ecd81e684248d /Lib/inspect.py | |
parent | f1b5ccb9937b8336078f023bf7deb6615a5e28c8 (diff) | |
download | cpython-6dfbc5d98eee400fa7b775b53c11a4e37fca3547.zip cpython-6dfbc5d98eee400fa7b775b53c11a4e37fca3547.tar.gz cpython-6dfbc5d98eee400fa7b775b53c11a4e37fca3547.tar.bz2 |
Issue #13248: Remove inspect.getmoduleinfo() from 3.6 (deprecated in 3.3)
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 4e78d80..305aafe 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -623,23 +623,6 @@ def getfile(object): raise TypeError('{!r} is not a module, class, method, ' 'function, traceback, frame, or code object'.format(object)) -ModuleInfo = namedtuple('ModuleInfo', 'name suffix mode module_type') - -def getmoduleinfo(path): - """Get the module name, suffix, mode, and module type for a given file.""" - warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning, - 2) - with warnings.catch_warnings(): - warnings.simplefilter('ignore', PendingDeprecationWarning) - import imp - filename = os.path.basename(path) - suffixes = [(-len(suffix), suffix, mode, mtype) - for suffix, mode, mtype in imp.get_suffixes()] - suffixes.sort() # try longest suffixes first, in case they overlap - for neglen, suffix, mode, mtype in suffixes: - if filename[neglen:] == suffix: - return ModuleInfo(filename[:neglen], suffix, mode, mtype) - def getmodulename(path): """Return the module name for a given file, or None.""" fname = os.path.basename(path) |