This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git
The following commit(s) were added to refs/heads/main by this push:
new 1e01b9a4b chore(python): disable pyfory.format import warning (#2476)
1e01b9a4b is described below
commit 1e01b9a4b5c8a3453479db97903af065114bd591
Author: Shawn Yang <[email protected]>
AuthorDate: Fri Aug 15 11:51:24 2025 +0800
chore(python): disable pyfory.format import warning (#2476)
## What does this PR do?
## Related issues
Closes #2475
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fory/issues/new/choose) describing the
need to do so and update the document if necessary.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
---
python/pyfory/__init__.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/python/pyfory/__init__.py b/python/pyfory/__init__.py
index caea3efbe..a5aa69f14 100644
--- a/python/pyfory/__init__.py
+++ b/python/pyfory/__init__.py
@@ -52,8 +52,12 @@ from pyfory.type import ( # noqa: F401 # pylint:
disable=unused-import
)
from pyfory._util import Buffer # noqa: F401 # pylint: disable=unused-import
+import warnings
+
try:
- from pyfory.format import * # noqa: F401,F403 # pylint:
disable=unused-import
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=RuntimeWarning)
+ from pyfory.format import * # noqa: F401,F403 # pylint:
disable=unused-import
except (AttributeError, ImportError):
pass
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]