Skip to content

Commit eb9465a

Browse files
committed
Clarify pynetinit.c, runtime build directives
pynetinit.c: Clarifiy its intent is for PY3 runtime.cs Remove unnecessary check for System.Text Simplifies import section
1 parent 073d7e8 commit eb9465a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/monoclr/pynetinit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void main_thread_handler(gpointer user_data)
135135
int ii = 0;
136136
for (ii = 0; ii < PyList_Size(syspath); ++ii)
137137
{
138-
#if PY_MAJOR_VERSION > 2
138+
#if PY_MAJOR_VERSION >= 3
139139
Py_ssize_t wlen;
140140
wchar_t *wstr = PyUnicode_AsWideCharString(PyList_GetItem(syspath, ii), &wlen);
141141
char *pydir = (char*)malloc(wlen + 1);
@@ -150,7 +150,7 @@ void main_thread_handler(gpointer user_data)
150150
strncpy(curdir, strlen(pydir) > 0 ? pydir : ".", 1024);
151151
strncat(curdir, slash, 1024);
152152

153-
#if PY_MAJOR_VERSION > 2
153+
#if PY_MAJOR_VERSION >= 3
154154
free(pydir);
155155
#endif
156156

src/runtime/runtime.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
22
using System.Runtime.InteropServices;
33
using System.Security;
4-
#if UCS4
54
using System.Text;
5+
6+
#if UCS4
67
using Mono.Unix;
7-
#elif UCS2 && PYTHON3
8-
using System.Text;
98
#endif
109

1110
namespace Python.Runtime

0 commit comments

Comments
 (0)