From 899f6e6bab997fed9618df477833716c54a5431d Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Thu, 26 May 2016 23:55:04 +0200 Subject: [PATCH] Alternative Fix for #182 --- src/runtime/importhook.cs | 9 +++++++++ 1 file changed, 9 insertions(+) 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(); }