@@ -47,7 +47,6 @@ const char *ue4_module_options = "linux_global_symbols";
47
47
#include " Android/AndroidApplication.h"
48
48
#endif
49
49
50
-
51
50
const char *UEPyUnicode_AsUTF8 (PyObject *py_str)
52
51
{
53
52
#if PY_MAJOR_VERSION < 3
@@ -249,7 +248,11 @@ void FUnrealEnginePythonModule::StartupModule()
249
248
if (GConfig->GetString (UTF8_TO_TCHAR (" Python" ), UTF8_TO_TCHAR (" Home" ), PythonHome, GEngineIni))
250
249
{
251
250
#if PY_MAJOR_VERSION >= 3
251
+ #if ENGINE_MINOR_VERSION >= 20
252
+ wchar_t *home = (wchar_t *)(TCHAR_TO_WCHAR (*PythonHome));
253
+ #else
252
254
wchar_t *home = (wchar_t *)*PythonHome;
255
+ #endif
253
256
#else
254
257
char *home = TCHAR_TO_UTF8 (*PythonHome);
255
258
#endif
@@ -263,7 +266,11 @@ void FUnrealEnginePythonModule::StartupModule()
263
266
FPaths::NormalizeFilename (PythonHome);
264
267
PythonHome = FPaths::ConvertRelativePathToFull (PythonHome);
265
268
#if PY_MAJOR_VERSION >= 3
269
+ #if ENGINE_MINOR_VERSION >= 20
270
+ wchar_t *home = (wchar_t *)(TCHAR_TO_WCHAR (*PythonHome));
271
+ #else
266
272
wchar_t *home = (wchar_t *)*PythonHome;
273
+ #endif
267
274
#else
268
275
char *home = TCHAR_TO_UTF8 (*PythonHome);
269
276
#endif
@@ -277,7 +284,11 @@ void FUnrealEnginePythonModule::StartupModule()
277
284
if (GConfig->GetString (UTF8_TO_TCHAR (" Python" ), UTF8_TO_TCHAR (" ProgramName" ), IniValue, GEngineIni))
278
285
{
279
286
#if PY_MAJOR_VERSION >= 3
287
+ #if ENGINE_MINOR_VERSION >= 20
288
+ wchar_t *program_name = (wchar_t *)(TCHAR_TO_WCHAR (*IniValue));
289
+ #else
280
290
wchar_t *program_name = (wchar_t *)*IniValue;
291
+ #endif
281
292
#else
282
293
char *program_name = TCHAR_TO_UTF8 (*IniValue);
283
294
#endif
@@ -290,7 +301,11 @@ void FUnrealEnginePythonModule::StartupModule()
290
301
FPaths::NormalizeFilename (IniValue);
291
302
IniValue = FPaths::ConvertRelativePathToFull (IniValue);
292
303
#if PY_MAJOR_VERSION >= 3
304
+ #if ENGINE_MINOR_VERSION >= 20
305
+ wchar_t *program_name = (wchar_t *)(TCHAR_TO_WCHAR (*IniValue));
306
+ #else
293
307
wchar_t *program_name = (wchar_t *)*IniValue;
308
+ #endif
294
309
#else
295
310
char *program_name = TCHAR_TO_UTF8 (*IniValue);
296
311
#endif
@@ -391,6 +406,7 @@ void FUnrealEnginePythonModule::StartupModule()
391
406
}
392
407
393
408
// Setup our own paths for PYTHONPATH
409
+ #if PLATFORM_WINDOWS
394
410
TArray<FString> OurPythonPaths = {
395
411
PythonHome,
396
412
FPaths::Combine (PythonHome, TEXT (" Lib" )),
@@ -403,10 +419,10 @@ void FUnrealEnginePythonModule::StartupModule()
403
419
PathVars.Append (OurPythonPaths);
404
420
FString ModifiedPath = FString::Join (PathVars, PathDelimiter);
405
421
FPlatformMisc::SetEnvironmentVar (TEXT (" PATH" ), *ModifiedPath);
422
+ #endif
406
423
}
407
424
408
425
409
-
410
426
#if PY_MAJOR_VERSION >= 3
411
427
init_unreal_engine_builtin ();
412
428
#if PLATFORM_ANDROID
0 commit comments