[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - pyuno/source

2021-01-05 Thread David Ostrovsky (via logerrit)
 pyuno/source/loader/pyuno_loader.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c82bb0297ea0dbba77823230ed36b81a39e8cbab
Author: David Ostrovsky 
AuthorDate: Mon Dec 21 07:56:11 2020 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jan 5 22:12:21 2021 +0100

tdf#138987 pyuno: PyEval_InitThreads is a no-op in Python 3.9

Change-Id: I220eecfa6aaf4d5cb12e3b4eacadf25843b41452
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108403
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 8be493744cafc2572c701e681ab147fa28c6bc39)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108719
Reviewed-by: David Ostrovsky 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/pyuno/source/loader/pyuno_loader.cxx 
b/pyuno/source/loader/pyuno_loader.cxx
index 07dc748235f9..dc428fb1f3a2 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -229,7 +229,9 @@ PythonInit() {
 
 // initialize python
 Py_Initialize();
+#if PY_VERSION_HEX < 0x0309
 PyEval_InitThreads();
+#endif
 
 PyThreadState *tstate = PyThreadState_Get();
 PyEval_ReleaseThread( tstate );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - pyuno/source

2020-06-20 Thread Caolán McNamara (via logerrit)
 pyuno/source/loader/pyuno_loader.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 448ba86f200942a580bdeaa9e8dff10cd32d86ed
Author: Caolán McNamara 
AuthorDate: Fri Jun 19 11:32:00 2020 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jun 20 13:13:33 2020 +0200

tdf#121384 don't leave a bare trailing : in PYTHONPATH

and don't insert any empty path entries if that situation
was to arise

Change-Id: I8d8183485f457c3e4385181fee07390c4bfef603
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96706
Tested-by: Tomáš Chvátal 
Tested-by: Jenkins
Reviewed-by: Tomáš Chvátal 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/pyuno/source/loader/pyuno_loader.cxx 
b/pyuno/source/loader/pyuno_loader.cxx
index 8556dfdde11f..07dc748235f9 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -140,6 +140,7 @@ static void setPythonHome ( const OUString & pythonHome )
 static void prependPythonPath( const OUString & pythonPathBootstrap )
 {
 OUStringBuffer bufPYTHONPATH( 256 );
+bool bAppendSep = false;
 sal_Int32 nIndex = 0;
 while( true )
 {
@@ -155,15 +156,24 @@ static void prependPythonPath( const OUString & 
pythonPathBootstrap )
 }
 OUString systemPath;
 osl_getSystemPathFromFileURL( fileUrl.pData, &(systemPath.pData) );
-bufPYTHONPATH.append( systemPath );
-bufPYTHONPATH.append( static_cast(SAL_PATHSEPARATOR) );
+if (!systemPath.isEmpty())
+{
+if (bAppendSep)
+
bufPYTHONPATH.append(static_cast(SAL_PATHSEPARATOR));
+bufPYTHONPATH.append(systemPath);
+bAppendSep = true;
+}
 if( nNew == -1 )
 break;
 nIndex = nNew + 1;
 }
 const char * oldEnv = getenv( "PYTHONPATH");
 if( oldEnv )
+{
+if (bAppendSep)
+bufPYTHONPATH.append( static_cast(SAL_PATHSEPARATOR) 
);
 bufPYTHONPATH.append( OUString(oldEnv, strlen(oldEnv), 
osl_getThreadTextEncoding()) );
+}
 
 OUString envVar("PYTHONPATH");
 OUString envValue(bufPYTHONPATH.makeStringAndClear());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits