Skip to content

Commit

Permalink
BUG: Don't put non-str in sys.path
Browse files Browse the repository at this point in the history
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
1 parent 0f5f96e commit a3d0f25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a3d0f25

Please sign in to comment.