| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5c9f035 commit 7765474
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,9 +140,9 @@ public static void Initialize() | |||
| 140 | 140 | Initialize(setSysArgv: true); | |
| 141 | 141 | } | |
| 142 | 142 | ||
| 143 | - public static void Initialize(bool setSysArgv = true) | ||
| 143 | + public static void Initialize(bool setSysArgv = true, bool initSigs = false) | ||
| 144 | 144 | { | |
| 145 | - Initialize(Enumerable.Empty<string>(), setSysArgv: setSysArgv); | ||
| 145 | + Initialize(Enumerable.Empty<string>(), setSysArgv: setSysArgv, initSigs: initSigs); | ||
| 146 | 146 | } | |
| 147 | 147 | ||
| 148 | 148 | /// <summary> | |
@@ -153,8 +153,9 @@ public static void Initialize(bool setSysArgv = true) | |||
| 153 | 153 | /// more than once, though initialization will only happen on the | |
| 154 | 154 | /// first call. It is *not* necessary to hold the Python global | |
| 155 | 155 | /// interpreter lock (GIL) to call this method. | |
| 156 | + /// initSigs can be set to 1 to do default python signal configuration. This will override the way signals are handled by the application. | ||
| 156 | 157 | /// </remarks> | |
| 157 | - public static void Initialize(IEnumerable<string> args, bool setSysArgv = true) | ||
| 158 | + public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false) | ||
| 158 | 159 | { | |
| 159 | 160 | if (!initialized) | |
| 160 | 161 | { | |
@@ -164,7 +165,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true) | |||
| 164 | 165 | // during an initial "import clr", and the world ends shortly thereafter. | |
| 165 | 166 | // This is probably masking some bad mojo happening somewhere in Runtime.Initialize(). | |
| 166 | 167 | delegateManager = new DelegateManager(); | |
| 167 | - Runtime.Initialize(); | ||
| 168 | + Runtime.Initialize(initSigs); | ||
| 168 | 169 | initialized = true; | |
| 169 | 170 | Exceptions.Clear(); | |
| 170 | 171 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -269,11 +269,11 @@ public enum MachineType | |||
| 269 | 269 | /// <summary> | |
| 270 | 270 | /// Initialize the runtime... | |
| 271 | 271 | /// </summary> | |
| 272 | - internal static void Initialize() | ||
| 272 | + internal static void Initialize(bool initSigs) | ||
| 273 | 273 | { | |
| 274 | 274 | if (Py_IsInitialized() == 0) | |
| 275 | 275 | { | |
| 276 | - Py_Initialize(); | ||
| 276 | + Py_InitializeEx(initSigs ? 1 : 0); | ||
| 277 | 277 | } | |
| 278 | 278 | ||
| 279 | 279 | if (PyEval_ThreadsInitialized() == 0) | |
@@ -727,6 +727,9 @@ internal static unsafe long Refcount(IntPtr op) | |||
| 727 | 727 | [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] | |
| 728 | 728 | internal static extern void Py_Initialize(); | |
| 729 | 729 | ||
| 730 | + [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] | ||
| 731 | + internal static extern void Py_InitializeEx(int initsigs); | ||
| 732 | + | ||
| 730 | 733 | [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] | |
| 731 | 734 | internal static extern int Py_IsInitialized(); | |
| 732 | 735 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments