You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defgetmoduleinfo(path):
"""Get the module name, suffix, mode, and module type for a given file."""warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning,
2)
withwarnings.catch_warnings():
warnings.simplefilter('ignore', PendingDeprecationWarning)
importimpfilename=os.path.basename(path)
suffixes= [(-len(suffix), suffix, mode, mtype)
forsuffix, mode, mtypeinimp.get_suffixes()]
suffixes.sort() # try longest suffixes first, in case they overlapforneglen, suffix, mode, mtypeinsuffixes:
iffilename[neglen:] ==suffix:
returnModuleInfo(filename[:neglen], suffix, mode, mtype)
The imp module is deprecated and set for removal in Python 3.12, due for release in October:
This project uses the imp module in two examples:
For example:
Python Code
The imp module is deprecated and set for removal in Python 3.12, due for release in October:
Please update the tests so they will continue working with 3.12.
The text was updated successfully, but these errors were encountered: