From cbf5f7ad619a967bd54482e1d1df36d80b28145a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
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

