Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved module importing / support for namespace packages #62

Merged
merged 3 commits into from May 3, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Diff settings

Always

Just for now

Prev

BUG: Don't put non-str in sys.path

Even as documented that other types are ignored [1],
it seemed to break on other versions of Python [2].

[1]: https://docs.python.org/3/library/sys.html#sys.path
[2]: https://travis-ci.org/pdoc3/pdoc/jobs/527591043#L218-L270
  • Loading branch information...
kernc committed May 3, 2019
commit a3d0f25ae3f503cb125e3d56af6d5b04e93c6f37
@@ -162,7 +162,7 @@ def import_module(module, *, reload: bool = False) -> ModuleType:
@contextmanager
def _module_path(module):
from os.path import isfile, isdir, split, abspath, splitext
path, module = None, module
path, module = '_pdoc_dummy_nonexistent', module
if isdir(module) or isfile(module) and module.endswith(_SOURCE_SUFFIXES):
path, module = split(splitext(abspath(module))[0])
try:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.