Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WIP: 449 Py_Initialize_SignalConfiguration#450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
rmadsen-ks wants to merge9 commits intopythonnet:masterfromrmadsen-ks:449_Py_Initialize_SignalConfiguration
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
9 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletionsappveyor.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,9 @@ on_finish:

artifacts:
- path: dist\*
- path: TestResult.xml
name: TestResult
type: xml

notifications:
- provider: Slack
Expand Down
1 change: 1 addition & 0 deletionssrc/embed_tests/Python.EmbeddingTest.csproj
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -80,6 +80,7 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="TestConsoleInterrupt.cs" />
<Compile Include="dynamic.cs" />
<Compile Include="pyimport.cs" />
<Compile Include="pyinitialize.cs" />
Expand Down
Binary file addedsrc/embed_tests/TestConsoleInterrupt.cs
View file
Open in desktop
Binary file not shown.
9 changes: 5 additions & 4 deletionssrc/runtime/pythonengine.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -140,9 +140,9 @@ public static void Initialize()
Initialize(setSysArgv: true);
}

public static void Initialize(bool setSysArgv = true)
public static void Initialize(bool setSysArgv = true, bool initSigs = false)
{
Initialize(Enumerable.Empty<string>(), setSysArgv: setSysArgv);
Initialize(Enumerable.Empty<string>(), setSysArgv: setSysArgv, initSigs: initSigs);
}

/// <summary>
Expand All@@ -153,8 +153,9 @@ public static void Initialize(bool setSysArgv = true)
/// more than once, though initialization will only happen on the
/// first call. It is *not* necessary to hold the Python global
/// interpreter lock (GIL) to call this method.
/// initSigs can be set to 1 to do default python signal configuration. This will override the way signals are handled by the application.
/// </remarks>
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false)
{
if (!initialized)
{
Expand All@@ -164,7 +165,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
// during an initial "import clr", and the world ends shortly thereafter.
// This is probably masking some bad mojo happening somewhere in Runtime.Initialize().
delegateManager = new DelegateManager();
Runtime.Initialize();
Runtime.Initialize(initSigs);
initialized = true;
Exceptions.Clear();

Expand Down
7 changes: 5 additions & 2 deletionssrc/runtime/runtime.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -206,11 +206,11 @@ public class Runtime
/// <summary>
/// Initialize the runtime...
/// </summary>
internal static void Initialize()
internal static void Initialize(bool initSigs)
{
if (Py_IsInitialized() == 0)
{
Py_Initialize();
Py_InitializeEx(initSigs ? 1 : 0);
}

if (PyEval_ThreadsInitialized() == 0)
Expand DownExpand Up@@ -604,6 +604,9 @@ internal static unsafe long Refcount(IntPtr op)
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern void Py_Initialize();

[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern void Py_InitializeEx(int initsigs);

[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern int Py_IsInitialized();

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp