Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
Interop fix for Py_ssize_t methods (it's produces problems only on Ne…
…tCoreApp 2.0).
  • Loading branch information
dse authored and filmor committed Oct 19, 2018
commit f121c44a04f77a02f9b98df798dae91dd7aa8ee0
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
- Fixed Visual Studio 2017 compat ([#434][i434]) for setup.py
- Fixed crashes when integrating pythonnet in Unity3d ([#714][i714]),
related to unloading the Application Domain
- Fixed interop methods with Py_ssize_t. NetCoreApp 2.0 is more sensitive than net40 and requires this fix. ([#531][p531])
- Fixed crash on exit of the Python interpreter if a python class
derived from a .NET class has a `__namespace__` or `__assembly__`
attribute ([#481][i481])
Expand Down Expand Up @@ -688,3 +689,4 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
[p163]: https://github.com/pythonnet/pythonnet/pull/163
[p625]: https://github.com/pythonnet/pythonnet/pull/625
[i131]: https://github.com/pythonnet/pythonnet/issues/131
[p531]: https://github.com/pythonnet/pythonnet/pull/531
6 changes: 2 additions & 4 deletions src/embed_tests/TestPySequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ public void TestRepeat()
PyObject actual = t1.Repeat(3);
Assert.AreEqual("FooFooFoo", actual.ToString());

// On 32 bit system this argument should be int, but on the 64 bit system this should be long value.
// This works on the Framework 4.0 accidentally, it should produce out of memory!
// actual = t1.Repeat(-3);
// Assert.AreEqual("", actual.ToString());
actual = t1.Repeat(-3);
Assert.AreEqual("", actual.ToString());
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static void SetError(Exception e)
/// </remarks>
public static bool ErrorOccurred()
{
return Runtime.PyErr_Occurred() != 0;
return Runtime.PyErr_Occurred() != IntPtr.Zero;
}

/// <summary>
Expand Down
Loading