package/qt5/qt5webengine-chromium: backport upstream patch to fix Python 3.12 issue

Two Python scripts from the upstream Chromium code base uselessly
imported the "imp" module, causing the build to fail with Python
3.12. This commit backports an upstream patch that fixes this issue.

Traceback (most recent call last):
File "/home/thomas/buildroot/buildroot/output/build/qt5webengine-5.15.14/src/core/release/../../3rdparty/chromium/mojo/public/tools/mojom/mojom_parser.py", line 23, in <module>
  from mojom.generate import translate
File "/home/thomas/buildroot/buildroot/output/build/qt5webengine-5.15.14/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/translate.py", line 17, in <module>
  from mojom.generate import generator
File "/home/thomas/buildroot/buildroot/output/build/qt5webengine-5.15.14/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py", line 12, in <module>
  from mojom import fileutil
File "/home/thomas/buildroot/buildroot/output/build/qt5webengine-5.15.14/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/fileutil.py", line 6, in <module>
  import imp
ModuleNotFoundError: No module named 'imp'

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Thomas Petazzoni
2024-07-13 15:25:08 +02:00
parent 8dc7445056
commit 34857f644b

View File

@@ -0,0 +1,47 @@
From f684c6fb3532138e3408fa17d4b6610162647365 Mon Sep 17 00:00:00 2001
From: Bruno Pitrus <brunopitrus@hotmail.com>
Date: Tue, 25 Jul 2023 18:34:09 +0000
Subject: [PATCH] Remove unused python import
The `imp` module has been removed in Python 3.12 causing these scripts to error out.
Change-Id: Ic7c038d21b86052bdda13015f80934db52a2143e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4714859
Auto-Submit: Bruno Pitrus <brunopitrus@hotmail.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/main@{#1174966}
Upstream: https://github.com/chromium/chromium/commit/f5f6e361d037c31630661186e7bd7b31d2784cb8
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
chromium/mojo/public/tools/mojom/mojom/fileutil.py | 1 -
chromium/mojo/public/tools/mojom/mojom/parse/lexer.py | 1 -
2 files changed, 2 deletions(-)
diff --git a/chromium/mojo/public/tools/mojom/mojom/fileutil.py b/chromium/mojo/public/tools/mojom/mojom/fileutil.py
index bf626f54798..e1c823daa3c 100644
--- a/chromium/mojo/public/tools/mojom/mojom/fileutil.py
+++ b/chromium/mojo/public/tools/mojom/mojom/fileutil.py
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import errno
-import imp
import os.path
import sys
diff --git a/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py b/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py
index 3e084bbf22b..1e8b49f245f 100644
--- a/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py
+++ b/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py
@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import imp
import os.path
import sys
--
2.25.1