diff --git a/src/runtime/importhook.cs b/src/runtime/importhook.cs index d1d27be8c..e8ac10f2b 100644 --- a/src/runtime/importhook.cs +++ b/src/runtime/importhook.cs @@ -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(); }