File sle12_python3_compat.patch of Package nodejs16-16.17.0-150300.7.9.1.src
Index: node-v16.13.0/configure
===================================================================
--- node-v16.13.0.orig/configure
+++ node-v16.13.0/configure
@@ -22,7 +22,7 @@ except ImportError:
from distutils.spawn import find_executable as which
print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
-acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6), (3, 4))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:
Index: node-v16.13.0/deps/npm/node_modules/node-gyp/lib/find-python.js
===================================================================
--- node-v16.13.0.orig/deps/npm/node_modules/node-gyp/lib/find-python.js
+++ node-v16.13.0/deps/npm/node_modules/node-gyp/lib/find-python.js
@@ -15,7 +15,7 @@ const programFiles = process.env.Program
const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)`
const winDefaultLocationsArray = []
-for (const majorMinor of ['39', '38', '37', '36']) {
+for (const majorMinor of ['39', '38', '37', '36', '34']) {
if (foundLocalAppData) {
winDefaultLocationsArray.push(
`${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`,
@@ -49,7 +49,7 @@ PythonFinder.prototype = {
log: logWithPrefix(log, 'find Python'),
argsExecutable: ['-c', 'import sys; print(sys.executable);'],
argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'],
- semverRange: '>=3.6.0',
+ semverRange: '>=3.4.0',
// These can be overridden for testing:
execFile: cp.execFile,