8000 Fixes for the merge · pythonnet/pythonnet@8c133e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8c133e3

Browse files
committed
Fixes for the merge
1 parent 1272b89 commit 8c133e3

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

src/embed_tests/pyinitialize.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void LoadDefaultArgs()
2525
{
2626
using (new PythonEngine())
2727
{
28-
using(var argv = new PyList(new BorrowedReference(Runtime.Runtime.PySys_GetObject("argv"))))
28+
using(var argv = new PyList(Runtime.Runtime.PySys_GetObject("argv")))
2929
{
3030
Assert.AreNotEqual(0, argv.Length());
3131
}
@@ -38,7 +38,7 @@ public static void LoadSpecificArgs()
3838
var args = new[] { "test1", "test2" };
3939
using (new PythonEngine(args))
4040
{
41-
using(var argv = new PyList(new BorrowedReference(Runtime.Runtime.PySys_GetObject("argv"))))
41+
using (var argv = new PyList(Runtime.Runtime.PySys_GetObject("argv")))
4242
{
4343
Assert.AreEqual(args[0], argv[0].ToString());
4444
Assert.AreEqual(args[1], argv[1].ToString());

src/runtime/pylist.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,6 @@ public PyList(PyObject[] items)
8585
}
8686
}
8787

88-
/// <summary>
89-
/// Constructor to make a PyList from a BorrowedReference.
90-
/// The list assumes ownership of the reference.
91-
/// </summary>
92-
/// <param name="r">The borrowed reference</param>
93-
internal PyList(BorrowedReference r)
94-
{
95-
IntPtr addr = r.DangerousGetAddress();
96-
if(!Runtime.PyList_Check(addr))
97-
{
98-
throw new ArgumentException("object is not a list");
99-
}
100-
101-
obj = addr;
102-
// Take ownership.
103-
Runtime.XIncref(addr);
104-
105-
}
106-
107-
10888
/// <summary>
10989
/// IsListType Method
11090
/// </summary>

0 commit comments

Comments
 (0)
0