| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7fcf401 commit 26f1438
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -246,6 +246,15 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw) | |||
| 246 | 246 | // and it was NOT an ImportError; bail out here. | |
| 247 | 247 | return IntPtr.Zero; | |
| 248 | 248 | } | |
| 249 | + | ||
| 250 | + if (mod_name == string.Empty) | ||
| 251 | + { | ||
| 252 | + // Most likely a missing relative import. | ||
| 253 | + // For example site-packages\bs4\builder\__init__.py uses it to check if a package exists: | ||
| 254 | + // from . import _html5lib | ||
| 255 | + // We don't support them anyway | ||
| 256 | + return IntPtr.Zero; | ||
| 257 | + } | ||
| 249 | 258 | // Otherwise, just clear the it. | |
| 250 | 259 | Exceptions.Clear(); | |
| 251 | 260 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments