File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
fluent.runtime/fluent/runtime Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -61,25 +61,21 @@ def format_message(
6161 if not bundle .has_message (msg_id ):
6262 continue
6363 msg = bundle .get_message (msg_id )
64- formatted_attrs = None
65- if msg .attributes :
66- formatted_attrs = {
67- attr : cast (
68- str ,
69- bundle .format_pattern (msg .attributes [attr ], args )[0 ],
70- )
71- for attr in msg .attributes
72- }
73- if not msg .value and formatted_attrs is None :
74- continue
75- elif not msg .value and formatted_attrs :
64+ formatted_attrs = {
65+ attr : cast (
66+ str ,
67+ bundle .format_pattern (msg .attributes [attr ], args )[0 ],
68+ )
69+ for attr in msg .attributes
70+ }
71+ if not msg .value :
7672 val = None
7773 else :
7874 val , _errors = bundle .format_pattern (msg .value , args )
7975 return FormattedMessage (
8076 # Never FluentNone when format_pattern called externally
8177 cast (str , val ),
82- formatted_attrs if formatted_attrs else {} ,
78+ formatted_attrs ,
8379 )
8480 return FormattedMessage (msg_id , {})
8581
You can’t perform that action at this time.
0 commit comments