You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
646 B

  1. diff --git a/Lib/imp.py b/Lib/imp.py
  2. index 781ff23..beeac70 100644
  3. --- a/Lib/imp.py
  4. +++ b/Lib/imp.py
  5. @@ -203,8 +203,9 @@ def load_package(name, path):
  6. extensions = (machinery.SOURCE_SUFFIXES[:] +
  7. machinery.BYTECODE_SUFFIXES[:])
  8. for extension in extensions:
  9. - path = os.path.join(path, '__init__'+extension)
  10. - if os.path.exists(path):
  11. + init_path = os.path.join(path, '__init__'+extension)
  12. + if os.path.exists(init_path):
  13. + path = init_path
  14. break
  15. else:
  16. raise ValueError('{!r} is not a package'.format(path))