1 Star 0 Fork 0

etux/qt6-qtwebengine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Partial-migration-from-imp-to-importlib.patch 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
František Zatloukal 提交于 2023-07-13 14:48 . Python 3.12 Fixes
From cbf5f7ad619a967bd54482e1d1df36d80b28145a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <[email protected]>
Date: Thu, 13 Jul 2023 12:18:00 +0200
Subject: [PATCH] Partial migration from imp to importlib
---
.../resources/protobufs/binary_proto_generator.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
index 2a1802d..ba67251 100755
--- a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
+++ b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
@@ -9,7 +9,7 @@
"""
from __future__ import print_function
import abc
-import imp
+from importlib import util
import optparse
import os
import re
@@ -68,7 +68,9 @@ class GoogleProtobufModuleImporter:
raise ImportError(fullname)
filepath = self._fullname_to_filepath(fullname)
- return imp.load_source(fullname, filepath)
+ spec = util.spec_from_file_location(fullname, filepath)
+ loaded = util.module_from_spec(spec)
+ return spec.loader.exec_module(loaded)
class BinaryProtoGenerator:
--
2.41.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/etux/qt6-qtwebengine.git
[email protected]:etux/qt6-qtwebengine.git
etux
qt6-qtwebengine
qt6-qtwebengine
f38-rv64

搜索帮助