void-packages/srcpkgs/qt6-pdf/patches/0114-chromium-118-python-3....

99 lines
4.4 KiB
Diff

--- a/src/3rdparty/chromium/base/write_build_date_header.py
+++ b/src/3rdparty/chromium/base/write_build_date_header.py
@@ -17,7 +17,7 @@ def main():
args = argument_parser.parse_args()
date_val = int(args.timestamp)
- date = datetime.datetime.utcfromtimestamp(date_val)
+ date = datetime.datetime.fromtimestamp(date_val, datetime.timezone.utc)
output = ('// Generated by //base/write_build_date_header.py\n'
'#ifndef BASE_GENERATED_BUILD_DATE_TIMESTAMP \n'
f'#define BASE_GENERATED_BUILD_DATE_TIMESTAMP {date_val}'
--- a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
+++ b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
@@ -40,6 +40,12 @@ class GoogleProtobufModuleImporter:
return filepath
return None
+ def load_source(name: str, path: str) -> types.ModuleType:
+ spec = importlib.util.spec_from_file_location(name, path)
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(module)
+ return module
+
def _module_exists(self, fullname):
return self._fullname_to_filepath(fullname) is not None
--- a/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/html_generation_controller.py
+++ b/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/html_generation_controller.py
@@ -18,7 +18,7 @@ class HTMLGenerationController(object):
def GetHTMLForInlineStylesheet(self, contents):
if self.current_module is None:
- if re.search('url\(.+\)', contents):
+ if re.search(r'url\(.+\)', contents):
raise Exception(
'Default HTMLGenerationController cannot handle inline style urls')
return contents
--- a/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/js_utils.py
+++ b/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/js_utils.py
@@ -4,4 +4,4 @@
def EscapeJSIfNeeded(js):
- return js.replace('</script>', '<\/script>')
+ return js.replace(r'</script>', r'<\/script>')
--- a/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py
+++ b/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py
@@ -293,6 +293,6 @@ class HTMLModuleParser():
html = ''
else:
if html.find('< /script>') != -1:
- raise Exception('Escape script tags with <\/script>')
+ raise Exception(r'Escape script tags with <\/script>')
return HTMLModuleParserResults(html)
--- a/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/style_sheet.py
+++ b/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/style_sheet.py
@@ -60,7 +60,7 @@ class ParsedStyleSheet(object):
return 'url(data:image/%s;base64,%s)' % (ext[1:], data.decode('utf-8'))
# I'm assuming we only have url()'s associated with images
- return re.sub('url\((?P<quote>"|\'|)(?P<url>[^"\'()]*)(?P=quote)\)',
+ return re.sub(r'url\((?P<quote>"|\'|)(?P<url>[^"\'()]*)(?P=quote)\)',
InlineUrl, self.contents)
def AppendDirectlyDependentFilenamesTo(self, dependent_filenames):
@@ -72,7 +72,7 @@ class ParsedStyleSheet(object):
raise Exception('@imports are not supported')
matches = re.findall(
- 'url\((?:["|\']?)([^"\'()]*)(?:["|\']?)\)',
+ r'url\((?:["|\']?)([^"\'()]*)(?:["|\']?)\)',
self.contents)
def resolve_url(url):
--- a/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py
+++ b/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py
@@ -119,8 +119,8 @@ class _PreprocessingLoader(jinja2.BaseLo
source = self.preprocess(f.read())
return source, path, lambda: mtime == os.path.getmtime(path)
- blockstart = re.compile('{%-?\s*(if|elif|else|for|block|macro)[^}]*%}')
- blockend = re.compile('{%-?\s*(end(if|for|block|macro)|elif|else)[^}]*%}')
+ blockstart = re.compile(r'{%-?\s*(if|elif|else|for|block|macro)[^}]*%}')
+ blockend = re.compile(r'{%-?\s*(end(if|for|block|macro)|elif|else)[^}]*%}')
def preprocess(self, source):
lines = source.split('\n')
--- a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
+++ b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
@@ -16,6 +16,7 @@ import re
import subprocess
import sys
import traceback
+import types
class GoogleProtobufModuleImporter: