| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -291,6 +291,9 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw) | |||
| 291 | 291 | // We don't support them anyway | |
| 292 | 292 | return IntPtr.Zero; | |
| 293 | 293 | } | |
| 294 | + // Save the exception | ||
| 295 | + var originalException = new PythonException(); | ||
| 296 | + var originalExceptionMessage = originalException.ToString(); | ||
| 294 | 297 | // Otherwise, just clear the it. | |
| 295 | 298 | Exceptions.Clear(); | |
| 296 | 299 | ||
@@ -342,7 +345,7 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw) | |||
| 342 | 345 | ManagedType mt = tail.GetAttribute(name, true); | |
| 343 | 346 | if (!(mt is ModuleObject)) | |
| 344 | 347 | { | |
| 345 | - Exceptions.SetError(Exceptions.ImportError, $"No module named {name}"); | ||
| 348 | + Exceptions.SetError(Exceptions.ImportError, originalExceptionMessage); | ||
| 346 | 349 | return IntPtr.Zero; | |
| 347 | 350 | } | |
| 348 | 351 | if (head == null) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments