MCPcopy Index your code
hub / github.com/python/cpython / _is_stdlib_module

Method _is_stdlib_module

Lib/pydoc.py:534–553  ·  view source on GitHub ↗
(self, object, basedir=None)

Source from the content-addressed store, hash-verified

532 return '' if version is None else str(version)
533
534 def _is_stdlib_module(self, object, basedir=None):
535 basedir = self.STDLIB_DIR if basedir is None else basedir
536
537 try:
538 file = inspect.getabsfile(object)
539 except TypeError:
540 file = '(built-in)'
541
542 if sysconfig.is_python_build():
543 srcdir = sysconfig.get_config_var('srcdir')
544 if srcdir:
545 basedir = os.path.join(srcdir, 'Lib')
546
547 basedir = os.path.normcase(basedir)
548 return (isinstance(object, type(os)) and
549 (object.__name__ in ('errno', 'exceptions', 'gc',
550 'marshal', 'posix', 'signal', 'sys',
551 '_thread', 'zipimport')
552 or (file.startswith(basedir) and
553 not file.startswith(os.path.join(basedir, 'site-packages')))))
554
555# -------------------------------------------- HTML documentation generator
556

Callers 2

getdoclocMethod · 0.95
_get_versionMethod · 0.95

Calls 3

normcaseMethod · 0.80
joinMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected