File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ) ) ;
Original file line number Diff line number Diff 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>
You can’t perform that action at this time.
0 commit comments