| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -362,7 +362,7 @@ public static void EndAllowThreads(IntPtr ts) | |||
| 362 | 362 | public static PyObject ImportModule(string name) | |
| 363 | 363 | { | |
| 364 | 364 | IntPtr op = Runtime.PyImport_ImportModule(name); | |
| 365 | - Py.Throw(); | ||
| 365 | + Runtime.CheckExceptionOccurred(); | ||
| 366 | 366 | return new PyObject(op); | |
| 367 | 367 | } | |
| 368 | 368 | ||
@@ -377,7 +377,7 @@ public static PyObject ImportModule(string name) | |||
| 377 | 377 | public static PyObject ReloadModule(PyObject module) | |
| 378 | 378 | { | |
| 379 | 379 | IntPtr op = Runtime.PyImport_ReloadModule(module.Handle); | |
| 380 | - Py.Throw(); | ||
| 380 | + Runtime.CheckExceptionOccurred(); | ||
| 381 | 381 | return new PyObject(op); | |
| 382 | 382 | } | |
| 383 | 383 | ||
@@ -392,9 +392,9 @@ public static PyObject ReloadModule(PyObject module) | |||
| 392 | 392 | public static PyObject ModuleFromString(string name, string code) | |
| 393 | 393 | { | |
| 394 | 394 | IntPtr c = Runtime.Py_CompileString(code, "none", (IntPtr)257); | |
| 395 | - Py.Throw(); | ||
| 395 | + Runtime.CheckExceptionOccurred(); | ||
| 396 | 396 | IntPtr m = Runtime.PyImport_ExecCodeModule(name, c); | |
| 397 | - Py.Throw(); | ||
| 397 | + Runtime.CheckExceptionOccurred(); | ||
| 398 | 398 | return new PyObject(m); | |
| 399 | 399 | } | |
| 400 | 400 | ||
@@ -473,7 +473,7 @@ public static PyObject RunString( | |||
| 473 | 473 | code, flag, globals.Value, locals.Value | |
| 474 | 474 | ); | |
| 475 | 475 | ||
| 476 | - Py.Throw(); | ||
| 476 | + Runtime.CheckExceptionOccurred(); | ||
| 477 | 477 | ||
| 478 | 478 | return new PyObject(result); | |
| 479 | 479 | } | |
@@ -600,18 +600,7 @@ public static void SetArgv(IEnumerable<string> argv) | |||
| 600 | 600 | { | |
| 601 | 601 | string[] arr = argv.ToArray(); | |
| 602 | 602 | Runtime.PySys_SetArgvEx(arr.Length, arr, 0); | |
| 603 | - Py.Throw(); | ||
| 604 | - } | ||
| 605 | - } | ||
| 606 | - | ||
| 607 | - internal static void Throw() | ||
| 608 | - { | ||
| 609 | - using (GIL()) | ||
| 610 | - { | ||
| 611 | - if (Runtime.PyErr_Occurred() != 0) | ||
| 612 | - { | ||
| 613 | - throw new PythonException(); | ||
| 614 | - } | ||
| 603 | + Runtime.CheckExceptionOccurred(); | ||
| 615 | 604 | } | |
| 616 | 605 | } | |
| 617 | 606 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments