gh-64020: Deprecate pydoc.ispackage() (GH-20908)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Zackery Spytz 2023-12-27 06:04:31 -08:00 committed by GitHub
parent 4acf825058
commit 1ddd773293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

View file

@ -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)):