We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb03867 commit 8eec111Copy full SHA for 8eec111
Lib/test/test_importlib/test_util.py
@@ -799,8 +799,9 @@ def test_package(self):
799
with open(filename, "w", encoding="utf8") as fp:
800
print("attr = 'load_source_path_pkg'", file=fp)
801
802
- # Package cannot be imported from a directory
803
- with self.assertRaises(IsADirectoryError):
+ # Package cannot be imported from a directory. It can with
+ # IsADirectoryError on Unix and PermissionError on Windows.
804
+ with self.assertRaises(OSError):
805
importlib.util.load_source_path(modname, dirname)
806
807
# Loading a package __init__.py file is ok
0 commit comments