Skip to content

Commit 9bea24d

Browse files
authored
Merge branch 'master' into master
2 parents 0670bde + f544adc commit 9bea24d

14 files changed

Lines changed: 50 additions & 118 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
99

1010
### Added
1111

12+
### Changed
13+
14+
### Fixed
15+
16+
## [2.4.0][]
17+
18+
### Added
19+
1220
- Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
1321
- Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild).
1422
Currently there two side-by-side build systems that produces the same output (net40) from the same sources.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Embedding Python in .NET
4848
- All python objects should be declared as ``dynamic`` type.
4949
- Mathematical operations involving python and literal/managed types
5050
must have the python object first, eg. ``np.pi * 2`` works,
51-
``2 * np.pi`` doesnt.
51+
``2 * np.pi`` doesn't.
5252

5353
Example
5454
~~~~~~~

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def run(self):
637637

638638
setup(
639639
name="pythonnet",
640-
version="2.4.0-rc2",
640+
version="2.4.1-dev",
641641
description=".Net and Mono integration for Python",
642642
url="https://pythonnet.github.io/",
643643
license="MIT",
@@ -662,7 +662,6 @@ def run(self):
662662
"Programming Language :: Python :: 2",
663663
"Programming Language :: Python :: 2.7",
664664
"Programming Language :: Python :: 3",
665-
"Programming Language :: Python :: 3.4",
666665
"Programming Language :: Python :: 3.5",
667666
"Programming Language :: Python :: 3.6",
668667
"Programming Language :: Python :: 3.7",

src/SharedAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
// Version Information. Keeping it simple. May need to revisit for Nuget
2626
// See: https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/
2727
// AssemblyVersion can only be numeric
28-
[assembly: AssemblyVersion("2.4.0")]
28+
[assembly: AssemblyVersion("2.4.1")]

src/clrmodule/ClrModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static void initclr()
5353
{
5454
#if USE_PYTHON_RUNTIME_VERSION
5555
// Has no effect until SNK works. Keep updated anyways.
56-
Version = new Version("2.4.0"),
56+
Version = new Version("2.4.1"),
5757
#endif
5858
CultureInfo = CultureInfo.InvariantCulture
5959
};

src/clrmodule/clrmodule.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<RootNamespace>clrmodule</RootNamespace>
1010
<AssemblyName>clrmodule</AssemblyName>
1111
<PackageId>clrmodule</PackageId>
12-
<VersionPrefix>2.4.0</VersionPrefix>
12+
<VersionPrefix>2.4.1</VersionPrefix>
1313
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1414
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1515
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>

src/console/Console.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AssemblyName>nPython</AssemblyName>
99
<RootNamespace>Python.Runtime</RootNamespace>
1010
<PackageId>nPython</PackageId>
11-
<VersionPrefix>2.4.0</VersionPrefix>
11+
<VersionPrefix>2.4.1</VersionPrefix>
1212
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1313
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1414
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>

src/embed_tests/Python.EmbeddingTest.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AssemblyName>Python.EmbeddingTest</AssemblyName>
1111
<RootNamespace>Python.EmbeddingTest</RootNamespace>
1212
<PackageId>Python.EmbeddingTest</PackageId>
13-
<VersionPrefix>2.4.0</VersionPrefix>
13+
<VersionPrefix>2.4.1</VersionPrefix>
1414
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1515
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1616
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>

src/embed_tests/TestFinalizer.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,18 @@ public void CollectBasicObject()
3636
{
3737
Assert.IsTrue(Finalizer.Instance.Enable);
3838

39-
int thId = Thread.CurrentThread.ManagedThreadId;
4039
Finalizer.Instance.Threshold = 1;
4140
bool called = false;
41+
var objectCount = 0;
4242
EventHandler<Finalizer.CollectArgs> handler = (s, e) =>
4343
{
44-
Assert.AreEqual(thId, Thread.CurrentThread.ManagedThreadId);
45-
Assert.GreaterOrEqual(e.ObjectCount, 1);
44+
objectCount = e.ObjectCount;
4645
called = true;
4746
};
4847

48+
Assert.IsFalse(called);
49+
Finalizer.Instance.CollectOnce += handler;
50+
4951
WeakReference shortWeak;
5052
WeakReference longWeak;
5153
{
@@ -61,18 +63,16 @@ public void CollectBasicObject()
6163
Assert.NotZero(garbage.Count);
6264
Assert.IsTrue(garbage.Any(T => ReferenceEquals(T.Target, longWeak.Target)));
6365
}
64-
65-
Assert.IsFalse(called);
66-
Finalizer.Instance.CollectOnce += handler;
6766
try
6867
{
69-
Finalizer.Instance.CallPendingFinalizers();
68+
Finalizer.Instance.Collect(forceDispose: false);
7069
}
7170
finally
7271
{
7372
Finalizer.Instance.CollectOnce -= handler;
7473
}
7574
Assert.IsTrue(called);
75+
Assert.GreaterOrEqual(objectCount, 1);
7676
}
7777

7878
private static void MakeAGarbage(out WeakReference shortWeak, out WeakReference longWeak)
@@ -85,7 +85,7 @@ private static void MakeAGarbage(out WeakReference shortWeak, out WeakReference
8585

8686
private static long CompareWithFinalizerOn(PyObject pyCollect, bool enbale)
8787
{
88-
// Must larger than 512 bytes make sure Python use
88+
// Must larger than 512 bytes make sure Python use
8989
string str = new string('1', 1024);
9090
Finalizer.Instance.Enable = true;
9191
FullGCCollect();
@@ -164,10 +164,11 @@ internal static void CreateMyPyObject(IntPtr op)
164164
public void ErrorHandling()
165165
{
166166
bool called = false;
167+
var errorMessage = "";
167168
EventHandler<Finalizer.ErrorArgs> handleFunc = (sender, args) =>
168169
{
169170
called = true;
170-
Assert.AreEqual(args.Error.Message, "MyPyObject");
171+
errorMessage = args.Error.Message;
171172
};
172173
Finalizer.Instance.Threshold = 1;
173174
Finalizer.Instance.ErrorHandler += handleFunc;
@@ -193,6 +194,7 @@ public void ErrorHandling()
193194
{
194195
Finalizer.Instance.ErrorHandler -= handleFunc;
195196
}
197+
Assert.AreEqual(errorMessage, "MyPyObject");
196198
}
197199

198200
[Test]

src/runtime/Python.Runtime.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RootNamespace>Python.Runtime</RootNamespace>
99
<AssemblyName>Python.Runtime</AssemblyName>
1010
<PackageId>Python.Runtime</PackageId>
11-
<VersionPrefix>2.4.0</VersionPrefix>
11+
<VersionPrefix>2.4.1</VersionPrefix>
1212
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1313
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1414
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>

0 commit comments

Comments
 (0)