File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77
88## [ Unreleased]
99
10+ - Correct stringified name of ParserError exception.
11+
1012## [ 0.1.0a6] - 2024-11-05
1113
1214- Render dates in YYYY-MM-DD format.
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ use unic_langid::LanguageIdentifier;
1010
1111use pyo3:: create_exception;
1212
13- create_exception ! ( rustfluent, PyParserError , pyo3:: exceptions:: PyException ) ;
13+ create_exception ! ( rustfluent, ParserError , pyo3:: exceptions:: PyException ) ;
1414
1515#[ pymodule]
1616fn rustfluent ( m : & Bound < ' _ , PyModule > ) -> PyResult < ( ) > {
1717 m. add_class :: < Bundle > ( ) ?;
18- m. add ( "ParserError" , m. py ( ) . get_type_bound :: < PyParserError > ( ) ) ?;
18+ m. add ( "ParserError" , m. py ( ) . get_type_bound :: < ParserError > ( ) ) ?;
1919 Ok ( ( ) )
2020}
2121
@@ -43,7 +43,7 @@ impl Bundle {
4343 Ok ( resource) => resource,
4444 Err ( error) => {
4545 if strict {
46- return Err ( PyParserError :: new_err ( format ! (
46+ return Err ( ParserError :: new_err ( format ! (
4747 "Error when parsing {}." ,
4848 file_path
4949 ) ) ) ;
Original file line number Diff line number Diff line change @@ -170,3 +170,7 @@ def test_raises_parser_error_on_file_that_contains_errors_in_strict_mode():
170170 filename = str (data_dir / "errors.ftl" )
171171 with pytest .raises (fluent .ParserError , match = re .escape (f"Error when parsing { filename } ." )):
172172 fluent .Bundle ("fr" , [filename ], strict = True )
173+
174+
175+ def test_parser_error_str ():
176+ assert str (fluent .ParserError ) == "<class 'rustfluent.ParserError'>"
You can’t perform that action at this time.
0 commit comments