-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython3.patch
More file actions
60 lines (59 loc) · 2.79 KB
/
python3.patch
File metadata and controls
60 lines (59 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- VirtualBox-7.0.10/src/libs/xpcom18a4/python/gen_python_deps.py~ 2023-07-12 18:42:54.000000000 +0200
+++ VirtualBox-7.0.10/src/libs/xpcom18a4/python/gen_python_deps.py 2023-09-07 16:25:51.601179500 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
"""
Copyright (C) 2009-2025 Oracle and/or its affiliates.
--- VirtualBox-7.0.10/Config.kmk~ 2023-09-08 01:41:50.000000000 +0200
+++ VirtualBox-7.0.10/Config.kmk 2023-09-08 01:51:41.947941370 +0200
@@ -853,7 +853,7 @@
# unless VBOX_WITH_ONLY_PYTHON_LIMITED_API is overridden).
VBOX_WITH_MULTIVERSION_PYTHON ?= 1
# Only build the limited Python extension API version for 3.3 and later.
-VBOX_WITH_ONLY_PYTHON_LIMITED_API = 1
+# VBOX_WITH_ONLY_PYTHON_LIMITED_API = 1
# Build the Validation Kit.
VBOX_WITH_VALIDATIONKIT = 1
# Include unit tests (testcases) on the Validation Kit .ISO
--- VirtualBox-7.0.24/src/libs/xpcom18a4/python/src/PyGBase.cpp~ 2025-01-21 15:11:16.000000000 +0100
+++ VirtualBox-7.0.24/src/libs/xpcom18a4/python/src/PyGBase.cpp 2025-03-22 00:49:21.276649368 +0100
@@ -224,7 +224,7 @@
if (obIID==NULL) goto done;
args = Py_BuildValue("OOzi", ob, obIID, NULL, 0);
if (args==NULL) goto done;
- wrap_ret = PyEval_CallObject(func, args);
+ wrap_ret = PyObject_CallObject(func, args);
if (wrap_ret==NULL) goto done;
ok = Py_nsISupports::InterfaceFromPyObject(wrap_ret, iid, ppret, PR_FALSE, PR_FALSE);
#ifdef DEBUG
@@ -572,7 +572,7 @@
goto done;
}
// Make the call
- *ppResult = PyEval_CallObject(method, args);
+ *ppResult = PyObject_CallObject(method, args);
ret = *ppResult ? NS_OK : NS_ERROR_FAILURE;
done:
Py_XDECREF(method);
--- VirtualBox-7.0.24/src/libs/xpcom18a4/python/src/PyGInputStream.cpp~ 2025-01-21 15:11:16.000000000 +0100
+++ VirtualBox-7.0.24/src/libs/xpcom18a4/python/src/PyGInputStream.cpp 2025-03-22 00:54:42.396649345 +0100
@@ -103,15 +103,15 @@
const char *methodName = "read";
nsresult nr = InvokeNativeViaPolicy(methodName, &ret, "i", count);
if (NS_SUCCEEDED(nr)) {
-#if 0 /* VBox: new buffer protocol (though I could use it for Py_LIMITED_API and ditch the warning, but cpython specific) */
+#if 1 /* VBox: new buffer protocol (though I could use it for Py_LIMITED_API and ditch the warning, but cpython specific) */
Py_buffer py_view;
if (PyObject_GetBuffer(ret, &py_view, PyBUF_SIMPLE) == 0) {
if (py_view.len <= count) {
count = py_view.len;
} else {
- PyXPCOM_LogWarning("nsIInputStream::read() was asked for %d bytes, but the string returned is %d bytes - truncating!\n", count, py_size);
+ PyXPCOM_LogWarning("nsIInputStream::read() was asked for %d bytes, but the string returned is %d bytes - truncating!\n", count, py_view.len);
}
- memcpy(buf, py_view.py_buf, count);
+ memcpy(buf, py_view.buf, count);
PyBuffer_Release(&py_view);
*_retval = count;
} else {