mirror of
https://github.com/morgan9e/helium
synced 2026-04-14 08:24:04 +09:00
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
From 9c7aa2956eebd3f739dc9f60d041923cdb9ffa06 Mon Sep 17 00:00:00 2001
|
|
From: jj <jj@imput.net>
|
|
Date: Thu, 06 Nov 2025 09:27:04 -0800
|
|
Subject: [PATCH] Remove unneeded codecs usage in mojom_parser
|
|
|
|
Python >=3.14 loudly complains on every mojom_parser use, with:
|
|
|
|
DeprecationWarning: codecs.open() is deprecated. Use open() instead.
|
|
|
|
`codecs` has not been useful for a long time, so let's drop it,
|
|
and simply call open() instead.
|
|
|
|
Change-Id: Iaf4ab7bcdefb4c2b31aa825bac5d79970db0ba46
|
|
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7123066
|
|
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
|
|
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
|
|
Cr-Commit-Position: refs/heads/main@{#1541277}
|
|
---
|
|
|
|
--- a/mojo/public/tools/mojom/mojom_parser.py
|
|
+++ b/mojo/public/tools/mojom/mojom_parser.py
|
|
@@ -12,7 +12,6 @@ generate usable language bindings.
|
|
|
|
import argparse
|
|
import builtins
|
|
-import codecs
|
|
import errno
|
|
import json
|
|
import logging
|
|
@@ -180,7 +179,7 @@ def _CollectAllowedImportsFromBuildMetad
|
|
|
|
# multiprocessing helper.
|
|
def _ParseAstHelper(mojom_abspath, enabled_features):
|
|
- with codecs.open(mojom_abspath, encoding='utf-8') as f:
|
|
+ with open(mojom_abspath, encoding='utf-8') as f:
|
|
ast = parser.Parse(f.read(), mojom_abspath)
|
|
conditional_features.RemoveDisabledDefinitions(ast, enabled_features)
|
|
return mojom_abspath, ast
|