代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。