mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
gh-64020: Deprecate pydoc.ispackage() (GH-20908)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
4acf825058
commit
1ddd773293
4 changed files with 12 additions and 2 deletions
|
@ -345,6 +345,8 @@ def sort_attributes(attrs, object):
|
|||
|
||||
def ispackage(path):
|
||||
"""Guess whether a path refers to a package directory."""
|
||||
warnings.warn('The pydoc.ispackage() function is deprecated',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
if os.path.isdir(path):
|
||||
for ext in ('.py', '.pyc'):
|
||||
if os.path.isfile(os.path.join(path, '__init__' + ext)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue