Skip to content

Commit 9181ef3

Browse files
author
denfromufa
authored
Update runtime.cs
1 parent 6cd35f3 commit 9181ef3

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/runtime/runtime.cs

-34
Original file line numberDiff line numberDiff line change
@@ -318,35 +318,6 @@ internal static void Initialize()
318318
Runtime.PyList_Append(path, item);
319319
Runtime.XDecref(item);
320320
AssemblyManager.UpdatePath();
321-
322-
IntPtr sysmodule = Runtime.PyImport_ImportModule("sys");
323-
IntPtr sysargv = Runtime.PyObject_GetAttrString(sysmodule, "argv");
324-
//if sys.argv is available, no need to mess with it
325-
if (sysargv == IntPtr.Zero) {
326-
string[] clrargv;
327-
try {
328-
clrargv = System.Environment.GetCommandLineArgs();
329-
}
330-
catch (NotSupportedException) {
331-
// some platforms do not support argv
332-
// Need to add at least the list with empty string to sys.argv,
333-
// this is how python interpreter gets loaded in interactive mode
334-
clrargv = new string[] { String.Empty };
335-
}
336-
int vi = 0;
337-
int clrargc = clrargv.Length;
338-
IntPtr pylistargv = PyList_New(clrargc);
339-
foreach (string clrargvi in clrargv) {
340-
IntPtr pystrargvi = PyString_FromString(clrargvi);
341-
Runtime.XIncref(pystrargvi);
342-
int r = Runtime.PyList_SetItem(pylistargv, vi, pystrargvi);
343-
vi += 1;
344-
if (r < 0) {
345-
throw new PythonException();
346-
}
347-
}
348-
PySys_SetArgvEx(clrargc, pylistargv, 0);
349-
}
350321
}
351322

352323
internal static void Shutdown()
@@ -2125,11 +2096,6 @@ int updatepath
21252096
);
21262097
#endif
21272098

2128-
[DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl,
2129-
ExactSpelling = true, CharSet = CharSet.Ansi)]
2130-
internal unsafe static extern void
2131-
PySys_SetArgvEx(int argc, IntPtr argv, int updatepath);
2132-
21332099
[DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl,
21342100
ExactSpelling = true, CharSet = CharSet.Ansi)]
21352101
internal unsafe static extern IntPtr

0 commit comments

Comments
 (0)