Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/runtime/importhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
// and it was NOT an ImportError; bail out here.
return IntPtr.Zero;
}

if (mod_name == string.Empty)
{
// Most likely a missing relative import.
// For example site-packages\bs4\builder\__init__.py uses it to check if a package exists:
// from . import _html5lib
// We don't support them anyway
return IntPtr.Zero;
}
// Otherwise, just clear the it.
Exceptions.Clear();
}
Expand Down